Solved

Javascript __doPostback ignores Validation controls

Posted on 2014-10-22
2
320 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…

821 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