/    Sign up×
Community /Pin to ProfileBookmark

Focus on the submit

I have two text boxes, Username and Password and a Image submit button. I want to set focus on the submit image. I cannot use onLoad() method in the body tag, because the page loads multiple forms.

What can I use to set the focus on the Image submit button, can I use on blur on the password field.

Someone can reply with the answer. It will be greatly appreciated.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@JonaJun 18.2004 — [font=arial]Can you provide some HTML code or a link to an example Web page where you're incurring this problem? Also, if you could be a little more specific on your problem... You stated that you have multiple forms, are you trying to set focus to a particular form's submit image? As far as I know, it is indeed possible to use the onBlur event handler in password text fields.

Hope this helps.[/font]
Copy linkTweet thisAlerts:
@KorJun 18.2004 — 
onLoad() method in the body tag, because the page loads multiple forms.
[/quote]


So what?
Copy linkTweet thisAlerts:
@foreigner737Jul 08.2009 — I am trying to achieve the same thing.

I have an .htm page where I accept the username and password information of the customers and there is also a "go" button as .jpeg on right of these input fields.

I want to give the customers the opportunity to be able to press just on enter upon filling their user/pass information into the relevant fields.

For now, the .htm page which accepts the user/pass fields is not defined as a form.

The "go" button has just a hyperlink (a javascript()) which directs the customer to another page.

How to set focus on this .jpeg button?

Thanks for any advises.
×

Success!

Help @Vicky_ca 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.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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