RE: [PHP] javascript problem
| From: | Diego Fulgueira | Date: | Mon, 08 Jan 2001 20:59:26 +0000 |
| Subject: | RE: [PHP] javascript problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33311@lists.php.net to get a copy of this message | ||
If your field type input you could refer to
document.addstudent.login_id.value. But in this case, you have to refer to
it like this:
document.addstudent.login_id.options[document.addstudent.login_id.selectedIn
dex].value
Using with() saves you some code:
with(document.addstudent.login_id) {
selection=options[selectedIndex].value
}
I haven't try it so don't get mad if I am wrong, but you can check it in
developer.netscape.com, look for the javascript reference.
Cheers.
----- Original Message -----
From: "mike" <mike263263@yahoo.com>
To: <php-general@lists.php.net>
Sent: Monday, January 08, 2001 2:05 PM
Subject: [PHP] javascript problem
> The name of my php file is addstudent.php3. When the
> users make selection in the drop-down list,
>
> echo "<p><center>Select Student: <SELECT
> NAME=\"login_id\" onChange =\"goToUrl()\">";...
>
> a javascript function is called.
>
> echo "<SCRIPT Language =JAVASCRIPT>";
> echo "function goToUrl() ";
> echo "{";
> echo "selection = document.addstudent.login_id;";...
>
> The error message I got is
> "document.addstudent.login_id" is not an object.
>
> This function did work before. Could some experts help
> me out why it does not work any more? Thank you very
> much.
>
> haiqi
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - Share your holiday photos online!
> http://photos.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net