fr600
04-23-2006, 03:51 AM
Hi I've been trying to do this for like an hour but I couldn't do it. I'm a javascript noob. I would really appreciate your help.
This is the code:
<form name="download">
<input type="radio" name="file" value="image1.zip">Image 1
<input type="radio" name="file" value="image2.zip">Image 2
<input type="radio" name="file" value="image3.zip">Image 3
<input type="button" onclick="location=document.download.file.input[document.download.file.checked].value" value="Download">
</form>
This idea is that I want to select a filename from radio input and when I'll click that button, the file will be downloaded. I did it with select and options but radio input seems quite difficult for me. I hope you can help.
This is the code:
<form name="download">
<input type="radio" name="file" value="image1.zip">Image 1
<input type="radio" name="file" value="image2.zip">Image 2
<input type="radio" name="file" value="image3.zip">Image 3
<input type="button" onclick="location=document.download.file.input[document.download.file.checked].value" value="Download">
</form>
This idea is that I want to select a filename from radio input and when I'll click that button, the file will be downloaded. I did it with select and options but radio input seems quite difficult for me. I hope you can help.