[jQuery] Re: Validation plugin docs: links not working

2008-01-09 Thread Gonzo
Thanks for catching that. The docs for the validation plugin are currently being moved from the source code to the wiki and there has also been some re-organization for the upcoming release of v1.2, so the docs may be out of sync with the code for a few more days. We'll make sure to get these li

[jQuery] Re: jquery validation demo errors

2008-01-05 Thread Gonzo
Thanks for catching that problem. There was a problem when the metadata plugin switched from $.meta to $.metadata (see http://tinyurl.com/yv8mw5). These demo files must've been missed for the release of v1.1.2, but they are correct in current SVN. Jörn will probably update the demos on his site

[jQuery] Re: jquery validator addMethod library?

2008-01-05 Thread Gonzo
I don't think there are any lists of extra validation methods, other than the additional-methods.js file that comes with the plugin. Most of them are generic and useful as is, some of them are examples (like ziprange) that would need to be modified for each user. Feel free to contribute your val

[jQuery] Re: Only number

2007-11-29 Thread Gonzo
You can use the validation plugin (http://jquery.com/plugins/project/ validate). There is a number validation already (actually, there's number, digits only, and range), but I believe you'll need to create your own validation for only alpha characters. You can easily add your own validation rule

[jQuery] Re: serializeHash() instead of serializeArray()

2007-11-18 Thread Gonzo
Just build it as a plugin: (function($) { $.fn.extend({ serializeHash: function() { var hash = {}; $.each(this.serializeArray(), function() { hash[this.name] = this.value; }); return hash; }

[jQuery] Re: How to control order of events or wait until something is loaded?

2007-11-18 Thread Gonzo
getScript doesn't wait for the script to finish loading before continuing, so you are trying to call validator.setDefaults before the validator exists. This should work: function setupValidator() { $.validator.setDefaults({ submitHandler: function() { alert("submitted!");

[jQuery] Re: $('.class1,.class2').filter(':first') always finds first .class1

2007-11-06 Thread Gonzo
You could store the type of validation error in a variable (either global or in jQuery.data), then just apply a class of "fail" to the invalid elements. // check for validation errors var errorType = ''; if (required && no val) { errorType = 'required'; } if (email && invalid email) { err

[jQuery] Re: Form Valdation Issues

2007-11-02 Thread Gonzo
Something like this should work: function checkRadio() { var checked = false; $('input.amount').each(function() { if ($(this).is(':checked')) { checked = true; return false; } }); retur

[jQuery] Re: setInterval, ajax call and LiveQuery : strange bug

2007-11-01 Thread Gonzo
Don't use setInterval on methods that use ajax. Instead use setTimeout as the last action in the callback for the ajax request. The ajax request takes time, so making the request at a specific interval may result in requests being processed much closer together than expected. What you really wa