setfocus after alert in javascript

A

amy

I have the follow javascript code in xsl file.
function focusme()
{
alert('wow');
document.papercaltbl('printorder').focus();
}

When you click the Submit button in the table, it call this function
to set focus to the printorder input field.

If the printorder is the first input field, then the set focus does
not work the first time call the function. It works the second time
and thereafter.
Note, if there is not alert before set focus, then it works everytime.


Now if the printorder is not the first input field, then it works
every time when call the function( including the first time). It's so
weird.


Any thought?

Amy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top