Try this.

void function MyExampleFunction(theelement) {
        theelement.focus()
}

<body onload="MyExampleFunction(document.form_name.element_name)">


The variable theelement will refer to "document.form_name.element_name"
so there is no reason to repeat that portion in the function.

Robbert van Andel 


-----Original Message-----
From: Christian Ista [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 19, 2003 7:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Javascript function


Hello,

Example, I have this function :

void function MyExampleFunction(){
 document.form_name.element_name.focus();
}

I'd like do something like that, I call the function like that :
MyExampleFunction('form_name.element_name');

And do that :
void function MyExampleFunction(theelement){
 document.theelement.focus();
}

but that's not work ?

An idea ?

Christian,




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to