RE: [PHP] using javascript within php
| From: | Jay Blanchard | Date: | Mon, 07 Mar 2005 17:12:42 +0000 |
| Subject: | RE: [PHP] using javascript within php | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-210176@lists.php.net to get a copy of this message | ||
[snip]
I want to set focus on a text area with javascript if the entry by the
user
is not what I want.
if (isset($submitted){
if(empty($name)) {
$fname_error = " *Please Enter your firstname or initial";
//the code to set focus to the textbox should go here
}
[/snip]
if(empty($name)) {
$fname_error = " *Please Enter your firstname or initial";
//the code to set focus to the textbox should go here
echo "window.document.YOURFORMNAME.name.focus();";
}