Solved

Javascript __doPostback ignores Validation controls

Posted on 2014-10-22
2
306 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
Comment Utility
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
Comment Utility
Excellent thank you. I did search but missed this one.

Andy
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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 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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now