/    Sign up×
Community /Pin to ProfileBookmark

Accesskey and onBlur()

Hi all,
my problem has to do with a different behaviour between activating a button using a mouse click or an accessKey.

Basically, some input fields have an onBlur() event that gets started fine when the user clicks on a button (validation of the input field). Then the request is sent to the server, together with the appropriate parameters.

But when the user activates the submit button using accesskey, it seems that the onBlur() event is called “later”, and therefore cannot complete its task before the request is sent to the server ; therefore, some request parameters are wrong (like saying the field is invalid – because it’s not been validated … !)

Anybody experienced such behaviour ?

Every feedback welcome 🙂

Kind regards,
Regis

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceMar 08.2006 — Have you tried using the [b]onsubmit[/b] event of the FORM tag?
Copy linkTweet thisAlerts:
@rpiccandauthorMar 09.2006 — Hi,

I found the solution at http://www.faqts.com/knowledge_base/view.phtml/aid/33114/fid/145

Basically, you have to trap every key stroke ; if the event.altKey is true, then fire document.activeElement.onblur();

Works like a charm...

Kind regards,

Regis
×

Success!

Help @rpiccand 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.19,
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,
)...