Welcome Guest, Not a member yet? Register   Sign In
Trying to get jQuery/Ajax to work with CI
#5

[eluser]slowgary[/eluser]
Another thing I forgot... you're STILL attaching the event to the button's click. This is not a good way to do it. There are several ways to submit a form besides clicking on the submit button. You can simply hit enter on any input element, and even if you don't have inputs in your form, a user might tab to the submit buttons and hit the spacebar, in which case your AJAX would not execute and would seem broken to the user. You should always attach the event listener for forms to the form itself, listening for the 'submit' event. So instead of:
Code:
$('.updatebutton-362').click(function(){
});
It should be something like:
Code:
$('.updateform-362').bind('submit', function(){
});
You shouldn't assume anyone's going to click your button.


Messages In This Thread
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-27-2009, 01:45 AM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-27-2009, 12:05 PM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-27-2009, 09:06 PM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-27-2009, 10:24 PM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-27-2009, 10:30 PM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-28-2009, 02:29 AM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-28-2009, 10:24 AM
Trying to get jQuery/Ajax to work with CI - by El Forum - 06-28-2009, 09:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB