This topic is locked

Put cursor in search field on page load

9/12/2008 3:31:27 PM
PHPRunner General questions
U
Urnso author

Is there a way to have the cursor already in the search field when page loads? We want to scan barcodes to enter a part number. And now you have to put the cursor there.
Thx!

T
thesofa 9/12/2008

Is there a way to have the cursor already in the search field when page loads? We want to scan barcodes to enter a part number. And now you have to put the cursor there.

Thx!



Hi, I found this page about setting cursor in a field in my bookmarks, I hope it helps.

Sergey Kornilov admin 9/12/2008

Check how this done on Add/Edit pages via SetToFirstControl() function call.

<script>SetToFirstControl();</script>
T
thesofa 9/12/2008

Check how this done on Add/Edit pages via SetToFirstControl() function call.


<script>SetToFirstControl();</script>



that looks like a better option!

U
Urnso author 9/15/2008

can someone help me out with this one? I can't get it working. Thx!
I'm not sure where to add this code.

J
Jane 9/16/2008

Hi,
here is a sample code:

<script>

document.getElementById("ctlSearchFor").focus();

</script>



Add this code at the end of page on the Visual Editor tab in HTML mode.