473,320 Members | 1,828 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,320 software developers and data experts.

Help! Client-side validation problem

I have a required field with a client-side validator. It works as advertised
until I try to add code to block double submits and replace the image on
the submit button to give the users some feedback. I have localized the
problem to the definition of the form.onSubmit handler.

Without my blocker, it looks like:
onsubmit="ValidatorOnSubmit();"

Since my javascript to block the double submit and change the image should
only run if client-side validation passes, I have to insert the
ValidatorOnSubmit call before my script is invoked, then dot net adds it
again at the end. So, it looks like:

onsubmit="if (FormSubmitted == true){return
false;};ValidatorOnSubmit();BlockDoubleSubmit(Subm itButtonID);ValidatorOnSub
mit();"

Looks like it should work, but now the client-side validation does not take
place at all. I am out of ideas. Is there another way to get a script
function invoked only if the client-side validation passes?

Any help would be much appreciated.
Nov 18 '05 #1
5 1902
Hi Jim,

If you are disabling the submit button in your BlockDoubleSubmit() function,
it is occuring before the form submits. The disabled button will not submit
the page. You have to delay disabling this button until after the form
submission occurs.

Please see this thread for a detailed discussion on this issue.
http://www.asp.net/Forums/ShowPost.a...&PostID=500836

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Jim Brandley" <Ji**********@Intercim.com> wrote in message
news:OT**************@TK2MSFTNGP11.phx.gbl...
I have a required field with a client-side validator. It works as advertised until I try to add code to block double submits and replace the image on
the submit button to give the users some feedback. I have localized the
problem to the definition of the form.onSubmit handler.

Without my blocker, it looks like:
onsubmit="ValidatorOnSubmit();"

Since my javascript to block the double submit and change the image should
only run if client-side validation passes, I have to insert the
ValidatorOnSubmit call before my script is invoked, then dot net adds it
again at the end. So, it looks like:

onsubmit="if (FormSubmitted == true){return
false;};ValidatorOnSubmit();BlockDoubleSubmit(Subm itButtonID);ValidatorOnSub mit();"

Looks like it should work, but now the client-side validation does not take place at all. I am out of ideas. Is there another way to get a script
function invoked only if the client-side validation passes?

Any help would be much appreciated.

Nov 18 '05 #2
Not sure if you still need help.
Try this link out;
http://weblogs.asp.net/vga
particularly Intercepting form submissions and
Avoiding duplicated form submissions

I hope this helps,
Avinash
Nov 18 '05 #3
I'm not really disabling the button. It just changes "FormSubmitted" to
true, and changes the decoration on the button.

"Peter Blum" <PL****@Blum.info> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
Hi Jim,

If you are disabling the submit button in your BlockDoubleSubmit() function, it is occuring before the form submits. The disabled button will not submit the page. You have to delay disabling this button until after the form
submission occurs.

Please see this thread for a detailed discussion on this issue.
http://www.asp.net/Forums/ShowPost.a...&PostID=500836

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Jim Brandley" <Ji**********@Intercim.com> wrote in message
news:OT**************@TK2MSFTNGP11.phx.gbl...
I have a required field with a client-side validator. It works as

advertised
until I try to add code to block double submits and replace the image on
the submit button to give the users some feedback. I have localized the
problem to the definition of the form.onSubmit handler.

Without my blocker, it looks like:
onsubmit="ValidatorOnSubmit();"

Since my javascript to block the double submit and change the image should only run if client-side validation passes, I have to insert the
ValidatorOnSubmit call before my script is invoked, then dot net adds it
again at the end. So, it looks like:

onsubmit="if (FormSubmitted == true){return

false;};ValidatorOnSubmit();BlockDoubleSubmit(Subm itButtonID);ValidatorOnSub
mit();"

Looks like it should work, but now the client-side validation does not

take
place at all. I am out of ideas. Is there another way to get a script
function invoked only if the client-side validation passes?

Any help would be much appreciated.


Nov 18 '05 #4
Thanks - I've seen that one, but is doesn't solve my problem.

"Avinash" <av********@ureach.com> wrote in message
news:7d**************************@posting.google.c om...
Not sure if you still need help.
Try this link out;
http://weblogs.asp.net/vga
particularly Intercepting form submissions and
Avoiding duplicated form submissions

I hope this helps,
Avinash

Nov 18 '05 #5
I just found it. The problem was allowing ValidatorOnSubmit to run twice.
After reading through WebUIValidation.js, I changed it to the following:

if (FormSubmitted == true)

{return false;};

ValidatorOnSubmit();

if (event.returnValue)

{BlockDoubleSubmit(SubmitButtonID);return true;}

else {return false;};

Now it works great.

"Peter Blum" <PL****@Blum.info> wrote in message
news:eJ**************@TK2MSFTNGP11.phx.gbl...
Hi Jim,

If you are disabling the submit button in your BlockDoubleSubmit() function, it is occuring before the form submits. The disabled button will not submit the page. You have to delay disabling this button until after the form
submission occurs.

Please see this thread for a detailed discussion on this issue.
http://www.asp.net/Forums/ShowPost.a...&PostID=500836

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Jim Brandley" <Ji**********@Intercim.com> wrote in message
news:OT**************@TK2MSFTNGP11.phx.gbl...
I have a required field with a client-side validator. It works as

advertised
until I try to add code to block double submits and replace the image on
the submit button to give the users some feedback. I have localized the
problem to the definition of the form.onSubmit handler.

Without my blocker, it looks like:
onsubmit="ValidatorOnSubmit();"

Since my javascript to block the double submit and change the image should only run if client-side validation passes, I have to insert the
ValidatorOnSubmit call before my script is invoked, then dot net adds it
again at the end. So, it looks like:

onsubmit="if (FormSubmitted == true){return

false;};ValidatorOnSubmit();BlockDoubleSubmit(Subm itButtonID);ValidatorOnSub
mit();"

Looks like it should work, but now the client-side validation does not

take
place at all. I am out of ideas. Is there another way to get a script
function invoked only if the client-side validation passes?

Any help would be much appreciated.


Nov 18 '05 #6

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

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
9
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with...
4
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to...
2
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
0
by: tbatwork828 | last post by:
If you were like me trying to figure out how to launch context sensitive help topic by the context id, here is the link: http://weblogs.asp.net/kencox/archive/2004/09/12/228349.aspx and if...
5
by: Steve | last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp My expectation is that a developer using my DLL would be able to access this help file during his development time...
9
by: JJ | last post by:
Do you all use HTML help workshop to create your help system. I am finding it quite clumsy to use. Mayeb because I am not used to using it. Do any of you use any other techniques to create help...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.