JavaScript question

Results 1 to 3 of 3

Thread: JavaScript question

  1. #1
    Join Date
    Dec 1969

    Default JavaScript question

    I want a layer to become visible if the selection in a drop down box = "PC<BR>Applications"<BR><BR>Have tried select.... onChange=subCat()<BR>...<BR>if( SelectedIndex=="PC Applications"){<BR> y = &#039;visible&#039;<BR><BR>but get object does not support...<BR>Any ideas?<BR><BR>(IE fix only needed)<BR>Jay

  2. #2
    Join Date
    Dec 1969

    Default not sure but

    try <BR>= true <BR>or false <BR><BR>instead of = &#039;visible&#039;

  3. #3
    Join Date
    Dec 1969

    Default selectedIndex is a NUMBER

    (1) It is "selectedIndex" and *NOT* "SelectedIndex". JavaScript is case sensitive.<BR><BR>(2) will be the NUMBER of the clicked on &#060;OPTION&#062;, starting with zero. If you want to get the VALUE= of the &#060;OPTION VALUE="PC Applications"&#062; then you can do:<BR>&nbsp; &nbsp;[].value<BR><BR>If you want to get the *text* that follows the option, as in<BR>&nbsp; &nbsp; &#060;OPTION Value="PCA"&#062; PC Applications<BR>then you can do:<BR>&nbsp; &nbsp;[].text<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts