Just posted to a different thread, but should work here, too:

$(...).validate({
 submitHandler: function(form) {
   if (confirm("Really?") {
     form.submit();
   }
 }
});

Jörn

On Sun, Nov 16, 2008 at 5:33 PM, flycast <[EMAIL PROTECTED]> wrote:
>
> Here is the code. I have removed a bunch of Validation rules to make
> it shorter. The problem code is at the bottom.
>
> $(document).ready(function(){
>   $("#testForm").validate({
>                debug: false,
>
>                rules: {
>                        emp_applicationDate: {
>                                required: true,
>                                minlength: 2
>                        }
>
>                }, //End of rules section
>
>                messages: {
>                        termsAgreed: {
>                                minlength: "You must agree to the Terms and 
> Conditions above to
> submit."
>                        }//End of emp_termsAgreed section
>                }//End of Messages section
>
>
>        });//End of form validation
>
>
>        //Show the detail for each control that has "Query" on the end of the
> name.
>        $("[name$='Query']").click(function(){
>                if($(this).val() == "Yes"){
>                        $("[name='"+$(this).attr("name")+"Yes']").slideDown();
>                        $("[name='"+$(this).attr("name")+"No']").slideUp();
>                }else{
>                        $("[name='"+$(this).attr("name")+"Yes']").slideUp();
>                        $("[name='"+$(this).attr("name")+"No']").slideDown();
>                }
>        });
>
>
>        $("[name$='Query']").each(function(){
>                        $("[name='"+$(this).attr("name")+"Yes']").hide();
>                        $("[name='"+$(this).attr("name")+"No']").hide();
>        });
>
>        /*Hide all detail sections - to do this we need to check their value
> first.
>        It is possible that they have already been checked and the page was
> just refreshed.
>        To deal with this we need to close all the detail areas first and
> then show the
>        detail areas that are checked "yes".
>        */
>
>
>        $("[name$='Query']").each(function(){
>                if ($(this).attr("checked") == true && $(this).attr("value") ==
> "Yes" ){
>                        $("[name='"+$(this).attr("name")+"Yes']").show();
>                        $("[name='"+$(this).attr("name")+"No']").hide();
>                }
>                if ($(this).attr("checked") == true && $(this).attr("value") ==
> "No" ){
>                        $("[name='"+$(this).attr("name")+"Yes']").hide();
>                        $("[name='"+$(this).attr("name")+"No']").show();
>                }
>        });
>
>
>
> //Build names for signature
>
> $("[name^='emp_name']").blur(function () {
>      $("#namePrompt").text("Example: "+$("[name='emp_nameLast']").val
> ());
> var middleName = $("[name='emp_nameMiddle']").val();
> if (middleName.length > 0){
>      $("#namePrompt").text("Ex: "+$("[name='emp_nameFirst']").val()+"
> "+$("[name='emp_nameMiddle']").val()+" "+$("[name='emp_nameLast']").val
> ());
> }else{
>      $("#namePrompt").text("Ex: "+$("[name='emp_nameFirst']").val()+"
> "+$("[name='emp_nameLast']").val());
> }
> });
>
>
> jQuery.validator.addMethod( "testvalue",
> function(value, params) {
>   if (params.checked){
>      return true;
>   }else{
>      return false;
>   }
>  }, "It is required that you read and agree to the Terms and Agreement
> above before submitting.");
>
> });//End of document ready function
>
> function confSubmit(form) {
> if (confirm("Are you sure you want to submit the form?")) {
>   $("#testForm").submit();
> }else{
>   return false;
> }
>
> }//End of confSubmit function
>

Reply via email to