#1 (permalink)  
Old 06-01-2007, 05:12 AM
Registered User
 
Join Date: Jun 2007
Posts: 1
Download file using radio buttons

Hopefully someone can help me out...

I need to create a form which allows a user to input their email address and then select a file from a dropdown list/radio button. When submitted the chosen file will prompt a download and the email address will be forwarded to an email address/.csv file.

Are both actions possible or are they mutually exclusive?
Reply With Quote

  #2 (permalink)  
Old 06-03-2007, 04:44 PM
curtiss's Avatar
Moderator
 
Join Date: May 2003
Posts: 1,445
All is possible with JavaScript.

You simply need to write a javascript function that will be executed "onchange".

I think it would look something like:
Code:
function doWhat(what) {
window.open('http://myurl.com/downloads/'+what.options[what.selectedIndex].value, 'window_name');
document.myForm.submit();
}
Then, your selectbox would look something like this:
Code:
<form name='myForm' action='formprocessor.php' method='post' id='myForm'>
<label for='email'>Your e-mail address:</label><input type='text' name='email' id='email'>
<select name='mySelect' id='mySelect' onchange='doWhat(this);'>
<option value='myFile.zip'>ZIP version</option>
<option value='myFile.tar'>TAR version</option>
</select>
</form>
__________________
I hate Internet Explorer! Anyone with me?
Reply With Quote
  #3 (permalink)  
Old 06-03-2007, 06:31 PM
Allen's Avatar
Administrator
 
Join Date: Dec 2001
Location: Atlanta, Georgia, USA
Posts: 1,049
nice one curtiss!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with writing file in perl gugabaga Programming and Scripting 1 06-27-2006 09:17 AM
Looking For Two Different Things (Download Related) curtiss Off-Topic 0 03-29-2006 08:48 AM
Creating a file and saving it locally - PHP curtiss Programming and Scripting 6 03-25-2006 12:26 PM
Javascript and radio buttons byteme Programming and Scripting 1 01-24-2006 03:51 PM
CGI/Perl: How to run a program or download a file ShAdOw-HeLiX Programming and Scripting 2 11-22-2005 06:04 AM


All times are GMT -5. The time now is 07:43 AM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter