Solved

Javascript __doPostback ignores Validation controls

Posted on 2014-10-22
2
337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
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…

737 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