Mike Alsup wrote:
>> Another question: i want to disable the submit event of the form, yet my
>> code doesn't work "form.unbind is not a function"
> You can only unbind handlers that you've added. But in this case the
> answer is to add a handler that simple returns false.
>
> $('#myForm').submit(function() { return false; })
Another method (which I use in a form validation library) is to disable
& visually dim the form's submit button(s). E.g;
If !valid {submit.attr('disabled', true).css('opacity',0.5);}
If valid{submit.attr('disabled', false).css('opacity',1);}
--- clicking a button/input that is disabled will have no effect, thus
submit event will not fire. You can combine this w/ Mike's method
(intercepting the form's submit event) for a foolproof solution [that
is, if JS is enabled]
~ Brice
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/