Reputation: 78
I need some help with this. All I want is a simple drop down that you select an option and then hit Download. Formatted like this:
<select>
<option value="http://file/1234">file 1</option>
<option value="http://file/1234">file 2</option>
</select>
<button type="button">Download</button>
This isn't pulling or getting inserted to a database, just a simple select an option and press download. I could get it to work easily enough having it download on change, but that isn't how I need it to work.
Any help would be appreciated!
Upvotes: 1
Views: 828
Reputation: 1911
Use this but it does not use button your file get download just after selection
<form><select name="select" onchange="window.location.href= this.form.select.options[this.form.select.selectedIndex].value">
<option value="http://FILE">FILE1</option>
<option value="http://FILE">FILE2</option>
<option value="http://FILE">FILE3</option>
<option value="http://FILE">FILE</option>
</select></form>
Upvotes: 0
Reputation: 15714
This should work
$('button').click(function(){
window.location = $('select').val();
});
Upvotes: 4