[SOLV]Trying to change the value of a drop down list with JS
Posted: Fri Jun 29, 2007 7:56 am
I only know the very basic of Javascript so I'm going to have to ask for help on this one. I'm not sure if it's possible as I've been Googling for the past 30 minutes.
I have a drop down list with 2 potential values (Y or N) and they're all defaulted to Y. I'm trying to find some code that will change the value of all the drop down lists to N on the click of a button. I keep getting the error 'el is not defined'
This is the code I have at the moment:
I have a drop down list with 2 potential values (Y or N) and they're all defaulted to Y. I'm trying to find some code that will change the value of all the drop down lists to N on the click of a button. I keep getting the error 'el is not defined'
This is the code I have at the moment:
Code: Select all
<script>
function changeValue() {
document.test.list.el.selectedIndex = 0;
}
</script>