473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

onblur function interrupting form submission

I'm trying to set up a simple "change your password" form. I've got an
AJAX process that is checking the new password the user enters against
their current password to make sure they're changing it. This function
is firing via the password field's onBlur event handler.

I want to do some other form validation using the form's onSubmit
handler (onSubmit="return validateForm();", and if all those conditions
are met, the form submits.

Problem is, if focus is on that password field and the user attempts to
click the submit button, the onBlur event fires, and after that,
nothing happens. The flow seems to be interrupted - I get no further
activity indicating the click happened. No onFocus for the submit
button, no onClick for that button, no onSubmit events will fire, and
the form does not submit.

How do I continue the process beyond that onBlur function if the user
is trying to click the submit button?

Thanks in advance.

Feb 6 '06 #1
4 11849

jo**********@gmail.com wrote:
I'm trying to set up a simple "change your password" form. I've got an
AJAX process that is checking the new password the user enters against
their current password to make sure they're changing it. This function
is firing via the password field's onBlur event handler.
If the user has javascript disabled, what happens then? Do you do any
server-side validation?
I want to do some other form validation using the form's onSubmit
handler (onSubmit="return validateForm();", and if all those conditions
are met, the form submits.

Problem is, if focus is on that password field and the user attempts to
click the submit button, the onBlur event fires, and after that,
nothing happens. The flow seems to be interrupted - I get no further
activity indicating the click happened. No onFocus for the submit
button, no onClick for that button, no onSubmit events will fire, and
the form does not submit.

How do I continue the process beyond that onBlur function if the user
is trying to click the submit button?


Here's a scenario, let's just say that the server is under heavy
traffic, when the user submits the form, will your "AJAX" request come
back fast enough? Instead, I would say to keep your current validation
done through the onsubmit event handler and do the password checking on
the server-side. An even more plus is to do form validation on the
server-side as well, in case the user has turned off javascript.

Feb 6 '06 #2
When the AJAX process begins, I have a "message" area that is changed
to read "checking..." along with an animated spinning hourglass,
windows-mouse-cursor-style.

And yes, I'm doing server-side validation as well.

Yes, you're right, I could do all this server-side. At this point it's
the principle - there's got to be a way to do this, so know I'm curious
what it is.

Feb 6 '06 #3
jo**********@gmail.com said the following on 2/6/2006 5:14 PM:
I'm trying to set up a simple "change your password" form.
Then have one. They are easy.
I've got an AJAX process that is checking the new password
the user enters against their current password to make sure
they're changing it.
That is, without a doubt, the dumbest way to achieve it.
This function is firing via the password field's onBlur event handler.
That is almost, but not quite, dumber than the "AJAX Process".

Use the onchange, not the onblur
I want to do some other form validation using the form's onSubmit
handler (onSubmit="return validateForm();", and if all those conditions
are met, the form submits.
Then do it.
Problem is, if focus is on that password field and the user attempts to
click the submit button, the onBlur event fires, and after that,
nothing happens.
Flaw in your reasoning. Have your magical "AJAX Process" disable the
submit button.....
The flow seems to be interrupted - I get no further
activity indicating the click happened. No onFocus
for the submit button, no onClick for that button, no
onSubmit events will fire, and the form does not submit.
Welcome to the Web.
How do I continue the process beyond that onBlur function if the user
is trying to click the submit button?


Read above.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 6 '06 #4
jo**********@gmail.com said the following on 2/6/2006 5:35 PM:

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.
When the AJAX process begins,
No, when you *hope* it begins. It may not even be supported (and it's
not in some browsers).
I have a "message" area that is changed
to read "checking..." along with an animated spinning hourglass,
windows-mouse-cursor-style.
Does it have anything in that message about quoting what you are
replying to in Usenet? It should.
And yes, I'm doing server-side validation as well.
As you should - always.
Yes, you're right, I could do all this server-side.
And doing it client-side is nothing but a mere convenience to the user
who decides to allow it to happen.

At this point it's the principle - there's got to be a way to do this,
so know I'm curious what it is.


The Genie in the bottle has the solution. Reply to my other reply to you
and you might get an answer (it is in the other reply).

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 7 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bartosz Wegrzyn | last post by:
I do validate my form using onblur() event. In my example I have 3 fields in my form. name,address and city. I call my functions using onblur()="isname(this)" ...etc. My probllem is that when I...
2
by: Bartosz Wegrzyn | last post by:
I use onblue event to validate fields in my form. I do this onblur="return isname()" and so so ... I have one form with 20 fields. My problem is that when the focus is for example on the...
6
by: WindAndWaves | last post by:
Hi Gurus In my quest in putting my first javascript together, I am now trying to conquer something that seems trivial, but has taken me hours. I would like to format a field in a form once the...
4
by: Peloux | last post by:
Hi, I have written some htc in order to validate data in a form. most of htc are attached on 'onblur' event. Now, we would like to use the Enter Key to sublit form, so we use the following...
2
by: andyalean | last post by:
Hello javascript coders :( ,I am trying to add an onblur event to my code. This is where I dynamically create a textfield.I want to assign it an onblur event handler like so.How do I add a event...
2
by: Heiko Vainsalu | last post by:
Hi Hope somebody knows how to solve this one. *The Situation* A traditional situation where HTML form inputs are checked... (if simplified then it would look something like this) <form...
5
by: kaburke | last post by:
My application is a simple create/update/delete system, with user authentication. Everything is working well, except session timeouts are creating user-experience nightmares. The standard...
10
by: ljlolel | last post by:
So.. I have a form that submits to an ASP.net site made in C-sharp. The ASP site is not mine, i do not have the server side code. When I submit from my form by pressing the Submit button, I get...
4
by: rubenhan | last post by:
Hey, guys. My basic idea is this. When I write "1" in the pre-existing text field and onblur, I want to add a new field with a set of attributes, which turned out to be the same as the pre...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.