Solved

A button to download a file and post a form

Posted on 2002-07-05
13
145 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: 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!

 

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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
How do I show a login page over the login page? 5 55
Check input text, Number 7 51
Presenting my portfolio on the web? 11 48
HTML 5 Input Type Numeric 5 31
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Find out what you should include to make the best professional email signature for your organization.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

740 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