I have a select options list where a different function is called depending on the option chosen. I’m using an internal function to check the value of the option selected, then calling an external function based on the option chosen. My problem is that I cannot get the external function to execute. I have three if statements checking three values. After each if statement I have a function call like this:
[CODE]
function DoWhat()
{
var what = document.getElementById(‘Do’);
var value = what[what.selectedIndex].value;
if(value == ‘DoThis’)
{
DoThis();
}
if(value == ‘DoThat’)
{
DoThat();
}
if(value == ‘DoTheOther’)
{
DoTheOther();
}
}
[CODE]
<select id=”Do” onchange=”DoWhat();”>
<option value=”DoThis”>DoThis</option>
<option value=”DoThat”>DoThat</option>
<option value=”DoTheOther”>DoTheOther</option>
</select>
If I use an alert instead of DoThis(), DoThat() or DoTheOther the alert executes. The functions are in externally linked .js files, but won’t execute.
[CODE]
<script type=”text/javascript” src=”./JScript/DoThis.js”/></script>
<script type=”text/javascript” src=”./JScript/DoThat.js”/></script>
<script type=”text/javascript” src=”./JScript/DoTheOther.js”/></script>
Can anyone point out what if anything is wrong with this? Many thanks.