Solved

A button to download a file and post a form

Posted on 2002-07-05
13
139 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
 

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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now