Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Updating form fields in Netscape


Message #1 by "Tom Lynch" <tlynch@e...> on Fri, 16 Feb 2001 21:34:06
Tom,
Since I dont know what you are passing in as parameters.  This code will work
with both netscape and IE. To get the values of a dropdown box given that the
dropField is on the first form in the page.


var index
var value

index = document.forms[0].dropField.SelectedIndex;
value = document.forms[0].dropField.options[index].value;

Tom Lynch wrote:

> This is the function i am using and IE has no problems with it.  How do i
> do the "dropField.value = 0;" in Netscape?  Thanks if you can help
>
>     function dropPhoneCheck(phoneField, dropField)
>     {
>         if (dropField.value != 0)
>         {
>             if (phoneField.value == "")
>             {
>                 alert("Please enter the phone number first.");
>                 dropField.value = 0;
>                 phoneField.focus();
>             }
>         }
>     }
> 

  Return to Index