I am submitting a form using ajax and have a few questions.
 
I found pseudocoders validation plugin, looked at few others but not working
quite the way i want.
 
Can you submit the form ajax without validating the form and have nothing
happen until the response is sent back from the model / controller as valid
or not? Then depending on the response tell the script to do something?
 
I found that showing all your validation in the code to not be an optimum
approach. I know there is the bootstrap to remove specific validation
checks, but my major problem is unique or custom validation methods. If I
remove checking an email is unique the js says its fine. Hits the model and
it says no thats not a good email so the form does not save, yet the js has
gone thru saying its validated and shows user success message then the div
returns with the form hi-lighting the email error field.
 
Basically my form loads into a div, success its removed. But js says its
successful in validating so it removes the form, model says not valid and
returns the form back to correct errors, yet the js success function () has
run saying to the user updated successfully with other elements fading in,
out, toggle what not.


//validation occurs before sending if valid
$(this).ajaxSubmit({

    type:    'post',
    url:      '/manage/profile/',
    data:     queryString,
    target:   '#profile',
    success: function(){
     $("#profile").slideToggle('slow');
     $(".success").show().fadeOut(5000).slideUp();
     }
             });
 
 
 
Now not sure if this can be done:
 
Idea would be user clicks the sumbit form and sends the data to the
controller to process if validates() but the form does nothing, sitting
waiting for the response and depending on the response do something.
 
Has anyone come up with a method that validates using just the controller
and model using ajax forms?
 
Open to ideas, suggestion.
 
Dave


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to