/    Sign up×
Community /Pin to ProfileBookmark

placing cursor in forms

i need a simple script that makes it so that once a page is loaded, typed text goes straight into a text box in a form. In other words, the text box is automatically selected. thanks!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@JPnycMar 06.2005 — <body onload="document.frames[0].txtBoxName.focus()">
Copy linkTweet thisAlerts:
@gameguy43authorMar 06.2005 — lol, never seen that before, where exactly do i put the name of the input? do i also need to give the form a name?
Copy linkTweet thisAlerts:
@gameguy43authorMar 06.2005 — figured it out, this is how it should look:
<i>
</i>&lt;body bgcolor="black" OnLoad="document.f.calc.focus()"&gt;

f is the form name and calc is the input name. thanks for pushing me in the right direction, pay attention to your cases!

lol, that O in "OnLoad" should be capitalised, must be something odd in the server...
×

Success!

Help @gameguy43 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...