if i have a drop down form field like this...
<select name="rating">
<option value="G">G</option>
<option value="PG">PG</option>
<option value="PG-13">PG-13</option>
<option value="R">R</option>
<option value="NC-17">NC-17</option>
<option value="Unrated">Unrated</option>
<option value="Not MPAA rated">Not MPAA rated</option>
</select>
How can i use javascript to ensure that say.. PG-13 is selected as default, and another time Unrated is? I have the value of the <option..> as a PHP variable, so i can just echo it into the page before it gets to the client
Something like
<script>
document.form.select.selected=="PG-13"
</script>
Cheers
Jee
<select name="rating">
<option value="G">G</option>
<option value="PG">PG</option>
<option value="PG-13">PG-13</option>
<option value="R">R</option>
<option value="NC-17">NC-17</option>
<option value="Unrated">Unrated</option>
<option value="Not MPAA rated">Not MPAA rated</option>
</select>
How can i use javascript to ensure that say.. PG-13 is selected as default, and another time Unrated is? I have the value of the <option..> as a PHP variable, so i can just echo it into the page before it gets to the client
Something like
<script>
document.form.select.selected=="PG-13"
</script>
Cheers
Jee
Comment