Paulie20
06-19-2009, 02:30 PM
Hi
Very new to javascript. Cannot get past this problem and will be grateful for some help on what I know is simple for an experienced js person.
Here is my code. I want the page to refresh when a new option is selected and the function called Results(xxx) to return xxx as the option selected from the form.
<td>
<script type="text/javascript">
<!--
passvar=getValues();
Results(passvar);
// -->
</script>
</td>
</tr>
</table>
<FORM name="FormDropDown">
<SELECT name="SelectGrade" onChange="document.location.reload (true)">>
<OPTION value="Womens">Womens</option>
<OPTION value="U17">Under 17s</option>
<OPTION value="First Grade">First Grade</option>
<OPTION value="Womens">Womens</option>
</SELECT>
</FORM>
</body>
</html>
Here is my script:
function getvalues(){
var dd = document.getElementById('FormDropDown');
getvalues = dd.options[dd.selectedIndex].text;
}
Very new to javascript. Cannot get past this problem and will be grateful for some help on what I know is simple for an experienced js person.
Here is my code. I want the page to refresh when a new option is selected and the function called Results(xxx) to return xxx as the option selected from the form.
<td>
<script type="text/javascript">
<!--
passvar=getValues();
Results(passvar);
// -->
</script>
</td>
</tr>
</table>
<FORM name="FormDropDown">
<SELECT name="SelectGrade" onChange="document.location.reload (true)">>
<OPTION value="Womens">Womens</option>
<OPTION value="U17">Under 17s</option>
<OPTION value="First Grade">First Grade</option>
<OPTION value="Womens">Womens</option>
</SELECT>
</FORM>
</body>
</html>
Here is my script:
function getvalues(){
var dd = document.getElementById('FormDropDown');
getvalues = dd.options[dd.selectedIndex].text;
}