|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Selecting a textbox
I have a form that asks for certain data like Name, Address, Phone, etc. How can I make the cursor automatically go to the first box without clicking in the box?
Bruce |
|
#2
|
|||
|
|||
|
RE: Selecting a textbox
This really belongs in "Client Side Things"...
The standards compliant way to do it is to give the input tag an ID and then use the getElementByID (javascript) function to find it and focus it. Code:
<form action="whatever.php" method="post">
<input type="text" id="NameBox" name="Name" value="">
</form>
<script type="text/javascript">
<!--
firstBox = document.getElementById("NameBox");
firstBox.focus();
// -->
</script>
|
|
#3
|
|||
|
|||
|
RE: Selecting a textbox
That worked great, Thankyou!
I'll check out the othe area you mentioned. Bruce |
|
#4
|
|||
|
|||
|
Message Moved
Thread moved from 'PHP Coding' to 'Client Side Things' by notepad.
Reason: |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Selecting a textbox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|