Jorn i think you might be able to help with this as it relates to your
validate stuff, again any help is great.

I did find some post relating to removing the submit handler for the
modal buttons but not sure how to get that to work, tried a few things
and couldn't get it to work.

On Apr 7, 11:07 pm, "wwor...@gmail.com" <wwor...@gmail.com> wrote:
> can't seem to get the "button" for the modal to fire off the event for
> validate can anymore see what i'm doing wrong here?
>
>         $(function() {
>                 var name = $("#name"),
>                         email = $("#email"),
>                         message = $("#message"),
>                         allFields = $([]).add(name).add(email).add(message),
>                         container = $('div.container');
>
>                 $("#dialog").dialog({
>                         bgiframe: true,
>                         autoOpen: false,
>                         resizable: false,
>                         height: 450,
>                         width: 350,
>                         modal: true,
>                         buttons: {
>                                 'Email Resume': function() {
>                                         $("#emailresume").validate({
>                                                         submitHandler: 
> function() {
>                                                                 $.ajax({
>                                                                   type: 
> 'POST',
>                                                                   url: 
> 'process.php?cmd=emailresume',
>                                                                   dataType: 
> 'html',
>                                                                   data: { 
> name: $('#name').val(), email: $('#email').val(),
> message: $('#message').val() },
>                                                                   success: 
> function(data){
>                                                                         
> $(this).dialog('close');
>                                                                   },
>                                                                   error: 
> function(){
>                                                                     alert("An 
> error has occurred. Please try again.");
>                                                                   },
>                                                                   complete: 
> function() {
>                                                                         
> $("#success").show();
>                                                                         
> $("#success").fadeOut(6000);
>                                                                   }
>                                                                 });
>                                                                 return false;
>                                                         },
>                                                         errorContainer: 
> container,
>                                                         errorLabelContainer: 
> $("ul", container),
>                                                         wrapper: 'li',
>                                                         meta: "validate",
>                                                         rules: {
>                                                                 name: {
>                                                                         
> required: true,
>                                                                         
> minlength: 3,
>                                                                         
> maxlength: 40
>                                                                 }
>                                                         },
>                                                         messages: {
>                                                                 name: {
>                                                                         
> required: "Name is required",
>                                                                         
> minlength: jQuery.format("Name is, minimum of {0}
> characters"),
>                                                                         
> maxlength: jQuery.format("Name is, maximum of {0}
> characters")
>                                                                 }
>                                                         }
>                                         });
>                                         //return false;
>                                 },
>                                 Cancel: function() {
>                                         $(this).dialog('close');
>                                 }
>                         },
>                         close: function() {
>                                 
> allFields.val('').removeClass('ui-state-error');
>                         }
>                 });
>
>                 $('#emailresume').click(function() {
>                         $('#dialog').dialog('open');
>                 });
>
>         });

Reply via email to