Page 1 of 1

ajax onload onfocus() event not being triggered

Posted: Wed May 23, 2007 7:27 am
by vanderlay
Hi All,

I am calling a page via ajax that sits in a table (simplified below)

index -> <table><td>ajax call goes here to page.php on click </td>/<table>
page.php code below,

now if i access this page by itself the onfocus() works, but when called via ajax it doesn't
any ideas or suggestions on how to fix this?

thanks
Art

Code: Select all

<html>
<head>
	<title>Example of setting focus on an element in a Form</title>
	<link rel="STYLESHEET" type="text/css" href="/style/jsc.css">
</head>

<body >
<FORM name="myform" action="submit-form.php">
Name: <input type="text" name="Name"><br>
Email: <input type="text" name="Email"><br>

<input type="submit" name="Submit" value="Submit">
</FORM>
<SCRIPT language="JavaScript">
document.myform.Name.focus();
</SCRIPT>
</body>
</html>

Posted: Wed May 23, 2007 7:34 am
by feyd
That's not an onload event.

Posted: Wed May 23, 2007 8:08 am
by vanderlay
hmm when the page loads, it does it thing does it not? or is it an onparse?

but thanks for the feedback and suggestions, it helped a lot....!:roll:

anyway, it works by it self not when used via ajax so any other thoughts?