By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

focus my edit box when page loads

P: n/a
How can I (in PHP) have my first edit box focused and ready for keyboard
input when the page loads
(yes, I am new to php :-D )
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
PHP is a server side language. You need to do this with a client side
language like JavaScript.

David wrote:
How can I (in PHP) have my first edit box focused and ready for keyboard input when the page loads
(yes, I am new to php :-D )


Jul 17 '05 #2

P: n/a
David wrote:
How can I (in PHP) have my first edit box focused and ready for keyboard
input when the page loads
(yes, I am new to php :-D )


Nothing to do with PHP ...

It's typically done via client-side script, as follows:
Somewhere in the <head> add:

<script
<!--
function focus_on_start()
{
document.NAMED_FORM.NAMED_TEXTBOX.focus();
}

<body .... onLoad=focus_on_start()>
....
...
<form name='NAMED_FORM'...>
<input size='50' name='NAMED_TEXTBOX'...>
....
...
...
etc.

And that should do it. won't work on systems with script disabled. There
is no way around that.
good ruck!
mark.

--
I am not an ANGRY man. Remove the rage from my email to reply.
Jul 17 '05 #3

P: n/a
thanks!

"Mark" <mw@ANGRYLanfear.com> wrote in message
news:PO********************@nventure.com...
David wrote:
How can I (in PHP) have my first edit box focused and ready for keyboard
input when the page loads
(yes, I am new to php :-D )


Nothing to do with PHP ...

It's typically done via client-side script, as follows:

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.