Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
And now it does nothing
Message
From
03/04/2013 13:10:55
 
 
To
03/04/2013 12:41:36
General information
Forum:
Javascript
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01569918
Message ID:
01569932
Views:
35
>>And the good news is, it doesn't error/log when "select Topic" is selected.
>>...the bad news....it doesn't do anything at all.
>>
>>Now, I've never claimed to be a Java-master and shan't be attempting to claim it for QUITE a while, but it seems to me that the if stmt is saying:
>>If selectedIndex > 0
>> display the information
>>else
>> throw up idiot box
>>
>>Is anyone seeing anything other than that?
>
>If this is Javascript, If should be lowercase and the condition within parentheses I believe. If there is no error, make sure the browser is set to show the Javascript errors.

Yep. The 'If' is a problem. This should work:
function SCDropDown(topiclist)
        {
            if (topiclist.selectedIndex > 0)
            {
                location.href='go.hcn?hcn2~recipe~'+topiclist.options[topiclist.selectedIndex].value;
            }
        else {
                alert('Please select a recipe');
            }
        }
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform