On Mon, Jun 1, 2009 at 8:20 PM, Dave Maharaj :: WidePixels.com
<[email protected]> wrote:
>
> i am trying to submit a form using jQuery and no luck.
>
> I load the form first into a div.
>
> $("a.edit_user").click(function(){
> var data_id = $(this).attr('id');
> $("#loading").show(function(){
> alert(data_id);
> $("#user").load('update/user' , function(){
> $("#loading").hide(function(){
> $("#user").fadeIn("slow");
> });
> });
> });
> return false;
> });
>
> Click submit and nothing.
You have a click handler on a link, not a form. In any case, you don't
appear to be sending anything to the server.
>
> I have the form.jquery loaded from malsup.com
>
> tried to even add a simple alert using window load when the form loads into
> the div to say form is loaded and nothing
>
>
> $('#UserUpdateForm').bind('submit', function() {
> $(this).ajaxSubmit({
> target: '#load_here'
> });
> return false; //
>
> });
> Can someone point me in the right direction or an example of what you have
> that works?
This is an example I have using jquery.form.js:
$('#SectionEditForm').ajaxForm({
success: function(responseText, statusText)
{
$('#section_content').html(responseText);
// other stuff ..
}
});
'SectionEditForm' is the ID of the form. There's no binding required,
as the plugin takes care of that. And the URL is taken from the form's
action attr.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---