473,651 Members | 3,024 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Valid atorOnSubmit(); "

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
ValidatorOnSubm it 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;};Validat orOnSubmit();Bl ockDoubleSubmit (SubmitButtonID );ValidatorOnSu b
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 1932
Hi Jim,

If you are disabling the submit button in your BlockDoubleSubm it() 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****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Jim Brandley" <Ji**********@I ntercim.com> wrote in message
news:OT******** ******@TK2MSFTN GP11.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="Valid atorOnSubmit(); "

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
ValidatorOnSubm it 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;};Validat orOnSubmit();Bl ockDoubleSubmit (SubmitButtonID );ValidatorOnSu b 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 "FormSubmit ted" to
true, and changes the decoration on the button.

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

If you are disabling the submit button in your BlockDoubleSubm it() 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****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Jim Brandley" <Ji**********@I ntercim.com> wrote in message
news:OT******** ******@TK2MSFTN GP11.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="Valid atorOnSubmit(); "

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
ValidatorOnSubm it 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;};Validat orOnSubmit();Bl ockDoubleSubmit (SubmitButtonID );ValidatorOnSu b
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********@ure ach.com> wrote in message
news:7d******** *************** ***@posting.goo gle.com...
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 ValidatorOnSubm it to run twice.
After reading through WebUIValidation .js, I changed it to the following:

if (FormSubmitted == true)

{return false;};

ValidatorOnSubm it();

if (event.returnVa lue)

{BlockDoubleSub mit(SubmitButto nID);return true;}

else {return false;};

Now it works great.

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

If you are disabling the submit button in your BlockDoubleSubm it() 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****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Jim Brandley" <Ji**********@I ntercim.com> wrote in message
news:OT******** ******@TK2MSFTN GP11.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="Valid atorOnSubmit(); "

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
ValidatorOnSubm it 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;};Validat orOnSubmit();Bl ockDoubleSubmit (SubmitButtonID );ValidatorOnSu b
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
6528
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 Workshop program: hcw.exe that's included with Visual Basic. This exact same file compiled perfectly with no notes, warnings or errors prior to reformatting my system. Prior to the reformatting, I copied the help.rtf file onto a CD and checked the box to...
9
4397
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 the microsoft HTML workshop utility, lets call it c:\path\help.chm. My question is how do you launch it from the GUI? What logic do I put behind the "help" button, in other words. I thought it would be os.spawnv(os.P_DETACH,...
4
3345
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 cmd.Cmd but I would also like to get the man-page-like help for classes and functions. Does anyone know how to do that? Thanks. Sarir
2
6469
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
6
4330
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 result in any way. Who can help me, I thank you very very much. list.cpp(main program) //-------------------------------------------------------------------------- - #pragma hdrstop #pragma argsused
6
3006
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 an html authoring tool to help you accomplish? 2. What do you expect from online help for a html authoring tool? 3. What audience do you think a freeware html authoring tool is directed towards?
0
568
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 link doesn't work, basically here is the article: An Exploration Into Launching Context-Sensitive HTML Help with Topic IDs in VB.NET I spent this evening investigating the HTML Help API as implemented in
5
3260
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 using "F1" help within the VB IDE. Is this expectation achievable In trying to test my help file in the IDE, I have a solution with 2 projects: the DLL and a tester. VB does not look for my help file; instead, it looks for path to my source code...
9
2242
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 for your progs? Whats the current popular approach to creating help? I am only wanting a straight help file accessible from a menu - no context sensitive stuff. TIA
1
6120
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 default property of object Label. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"' Label = New Object(){Box1, Box2, Box3, Box4, Box5, Box6, Box7, Box8, Box9, Box10, Box11,...
0
8361
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8278
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8807
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8701
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8584
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7299
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5615
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.