Thanks for the test! Rick
-----Original Message----- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of limodou Sent: Monday, April 16, 2007 10:58 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Will this code enable & disable a submit button? On 4/17/07, Rick Faircloth <[EMAIL PROTECTED]> wrote: > > > You would probably need to return a more complex object from the > > server that contained a boolean in addition to your text. Structures > > and JSON/WDDX work well for that kind of thing. You would then use > > the boolean to trigger an if () statement. > > Ummm.... could you elaborate a little on that? :o) > I tried the code of Sean, and it's ok, and I also can use this: <script type="text/javascript"> var enabled = true; toggleSubmit = function(form){ if(enabled) $("input:submit",form).attr("disabled",true); else $("input:submit",form).attr("disabled",false); enabled = !enabled; } </script> I use true or false, it's the same with 'disabled' or "". I tested it in IE 6.0 and FF 2.0. jquery 1.1.2 -- I like python! UliPad <<The Python Editor>>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou