So I’m trying to get a popup box to show when a user rates an item but the value of the drop-down menu won’t travel along with it. When I submit I would like it to grab the value and put it in the URL as a variable. Any ideas?
<form onsubmit="window.open('rateIt.php?rate=<?php echo **THE VALUE OF THE DROP-DOWN** ?>','popup','width=500,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false">
<select name="rate" id="rate">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<input name="rateit" type="submit" value="Rate It"/>
</form>
Supply your own function for your form’s submit event:
Just make sure you either put this script at the bottom of your page, or in your body’s
onloadhandler. If you just put it in theheadsection,getElementByIdwon’t find your form, since the dom won’t be ready yet.EDIT
Just make sure you add
valuesto these options: