I've got a choose file type select menu of two options: PDF and PowerPoint. Once you select PDF you can either click Download or Preview button.
Single select dropdown menu with two result buttons
Collapse
X
-
Can someone help me out with the code? Trying to achieve something like this.
(html)
Code:<form action="../"> <select name="fileType"> <option value1="name.pdf" value2="pdf.zip">PDF</option> <option value1="name.ppt" value2="ppt.zip>PowerPoint</option> <option value1="name.xls" value2="excel.zip>Excel</option> </select> <input type="button" value="Open in New Window!" onclick="ob=this.form.myDestination;window.open(ob.options[ob.selectedIndex].value1)"> <input type="button2" value="Open in New Window!" onclick="ob=this.form.myDestination;window.open(ob.options[ob.selectedIndex].value2)"> </form> <SCRIPT LANGUAGE="javascript"> <!-- function OnChange(dropdown) { var myindex = dropdown.selectedIndex var SelValue = dropdown.options[myindex].value var baseURL = <Some value based on SelValue> top.location.href = baseURL; return true; } //--> </SCRIPT>Comment
-
So, Jumprope: is that YOUR code that you posted or an example of what you want to have happen when everything is done and said?
IF that is YOUR code, then can you take a few moments and tell us what is wrong with it? What is it doing that it shouldn't and what have you tried to do to fix it?Comment
Comment