Just that, my first page opens where a user inputs a Social Security number. Lets say the input box name is "ss_num". How can I set the focus to that box when the page opens?
<body onLoad="document.myForm.ssn.focus()">
<form name="myForm">
<input name="ssn">
</form> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179 It's sad that some Americans proudly turn their backs on the very Flag the gives them the opportunity to do just that... - Mike
Hi Apollo6
This should work for you, change your body tag to say this:
<body onLoad="document.getElementById("ss_num".focus()"> Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs<10) &&(((parseInt(x.toString()+y.toString())-x-y)%9)!=0)){alert("I'm a monkey's uncle"}
For hellTell's code to work, make sure to set the id as well as the name...
<input name="ss_num" id="ss_num"> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179 It's sad that some Americans proudly turn their backs on the very Flag the gives them the opportunity to do just that... - Mike
Good point Mike
Not that my browser cares Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs<10) &&(((parseInt(x.toString()+y.toString())-x-y)%9)!=0)){alert("I'm a monkey's uncle"}
<body onload="document.Main.ssn_num1.focus()">
<form name="Main" action="benefit_data.php" method="post"> Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179 It's sad that some Americans proudly turn their backs on the very Flag the gives them the opportunity to do just that... - Mike
D'oh! Feeling stupid today.
I put double quotes within quotes on mine.
Should be:
<body onLoad="document.getElementById('ss_num1').focus()"> Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs<10) &&(((parseInt(x.toString()+y.toString())-x-y)%9)!=0)){alert("I'm a monkey's uncle"}
Hey - I didn't see that either HellTel. Which browser do you use that doesn't care about id vs. name? Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179 It's sad that some Americans proudly turn their backs on the very Flag the gives them the opportunity to do just that... - Mike
IE6. I just tried it and it didn't care if I put name=, getElementById still worked! Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs<10) &&(((parseInt(x.toString()+y.toString())-x-y)%9)!=0)){alert("I'm a monkey's uncle"}
Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs<10) && (((parseInt(Math.abs(x).toString()+Math.abs.toString())-Math.abs(x)-Math.abs)%9)!=0)) {alert("I'm a monkey's uncle"}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.