[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

A button to download a file and post a form

Posted on 2002-07-05
13
Medium Priority
?
150 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Suggested Courses

834 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