Solved

Javascript __doPostback ignores Validation controls

Posted on 2014-10-22
2
329 Views
Last Modified: 2014-10-22
Hi I have a form with a save button, this save button fires validation controls.

I also have a section of the form that if a response is given I just want to save the form, without the users having to press the Save button, they have to select YES from a confirm dialog box.

I'm doing this like so:

                if(arg == true){
                   
                    __doPostBack("<%=butSave.UniqueID%>", "");
                }

But its missing all the validation controls, how can I fix this?

Andy
0
Comment
Question by:Andy Green
2 Comments
 
LVL 11

Accepted Solution

by:
louisfr earned 500 total points
ID: 40396787
Found a page (http://forums.asp.net/t/1349427.aspx?js+__dopostback+and+Validation+Controls) with the following code sample:
if (Page_ClientValidate("mygroup"))
   __doPostBack(parameters);

Open in new window

0
 
LVL 3

Author Closing Comment

by:Andy Green
ID: 40396841
Excellent thank you. I did search but missed this one.

Andy
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question