Solved

A button to download a file and post a form

Posted on 2002-07-05
13
144 Views
Last Modified: 2010-04-09
Hey,
I thought it would be easy, maybe it is ...but not for me today. I just started creating html forms and I want a button to 1. validate data the data that the user must enter (the routine works fine), 2.Download a zip file, then 3. post the form. In that order. The download in the middle seems to be the problem. The only code I can employ is javascript. I would truly appreciate some help, I work in VB and I have little to no experience in web forms. I would like to hear the logic and flow of how I should do it. Thanks,
diek
0
Comment
Question by:diek_nf
  • 9
  • 3
13 Comments
 
LVL 19

Expert Comment

by:webwoman
ID: 7132071
Why does it have to be in that order? You do realize you can't FORCE the user to accept a download? It's completely up to them if they want it or not.

I'd forget trying to do the download in the middle -- complete/validate the form, post it, have that take them to the download page. Makes more sense.

And you need to handle the form on the SERVER -- client side javascript won't be much help in sending it. I assume you're using a mailto for the action? It's an inherently flakey way to do it. You don't have ANY control over whether it works or not, or what you get.
0
 

Author Comment

by:diek_nf
ID: 7132097
W,
You are correct, I would like them to file out the form. The download is a user manual so they want it. I cannot control the server side.\
d
0
 

Author Comment

by:diek_nf
ID: 7132118
w,
They are already on a download page, I don't want them to have to go to another. The powers that be, want to get the contact info. The validating is actually gathering any info, if there is I want to post it and send it along to the powers that be. Somewhere in ther I want a download to take place.
d
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:diek_nf
ID: 7132179
webwoman,
You can check out my not posting, but downloading version at:
http://www.compliancecenter.com/support/RequestUserManual_Working.htm.

Thank you for your input!

d
0
 

Author Comment

by:diek_nf
ID: 7132186
opps
http://www.compliancecenter.com/support/RequestUserManual_Working.htm

Funny how a little . can cause some much trouble.
0
 

Author Comment

by:diek_nf
ID: 7132359
are you out there?

i guess a download page is in order.
0
 

Accepted Solution

by:
GooseHW earned 100 total points
ID: 7132992
I'm not 100% sure, but if the page refreshes, redirects, etc. then you won't be able to download and post at the same time. Try setting the download to open in a new window.
0
 
LVL 19

Expert Comment

by:webwoman
ID: 7133257
Exactly. YOu can't do BOTH. You've got the form going to a form handler, which is fine -- but once they do THAT, it's not going to do a download. You can have the form handler redirect them to the manual, and if it forces a download, that's what will happen.
0
 

Author Comment

by:diek_nf
ID: 7133785
goose,
I appreciate your help but....I know the option is there to propose answers but most people don't like it. I consider an answer a resolution, telling me what you did is not an answer. If what I just wrote didn't annoy you too much I would like to get an answer.

I am a vb programmer in the middle of a vb project, I got the task of creating this web page/form. Having never created a web form before I need more than 'if the page refreshes, redirects, etc. then you won't be able to download and post at the same time. Try setting the download to open in a new window.'


webwoman,
So 'You can have the form handler redirect them to the manual, and if it forces a download, that's what will happen. ' Like I just said above.

thank you,
diek
0
 

Author Comment

by:diek_nf
ID: 7133827
g and w,
so a file download is treated the same as a new page?

Is this the approach I should employ
1. User fills in form - Page1
2. User clicks submit, info validated - page 1
3. Form handler redirects - Page 1
4. Page loads ( can a download happen here, if so what event would be best?)- Page 2
0
 
LVL 19

Expert Comment

by:webwoman
ID: 7134123
Exactly. Redirect to your download, call it just like it was a link or another page. If it's a file that the browser doesn't know, it will start a download automatically. Of course, the user has to accept the download, but if they're expecting one they'll accept it.
0
 

Author Comment

by:diek_nf
ID: 7134137
w,
Thanks, I'll be back,
d
0
 

Author Comment

by:diek_nf
ID: 7138787
Goose,
After I sorted out my stuff, it worked perfectly. Have a great day programming,
d
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
HTML5 save .Dat to server side 20 51
Browser Chrome downloads colored link 5 48
parse url to form? 7 26
AJAX Wordpress Not Reading Variable 2 32
This article discusses four methods for overlaying images in a container on a web page
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question