Hello,
Nice addon!
I have a (noob) question.
How do I interpret the response from AJAX?
e.g my app returns {success: true, valid: false, reason:'undefined error'}
How can I process the response in my success(response, options){} function (or should I process it some place else?)?
I know that using "response.responseText" it shows the whole message ({success: true, valid: false, reason:'undefined error'}), all I want to do is to break the values apart (e.g. test the validation).
Thanks

Hello,
Thanks for the prompt reply.
I got the ideea behing this plugin but here's what I need to do:

1. enter an ID in an input box.
2. the id is searched in background (using ajax provided by your plugin) to match a record in a database (php server side).
3. if a record is found I need to return the data associated with that record that is loaded into a form (the one containing the ID field also).

Now, here is how I am thinking to do that (I am open to suggestions)
1. when the ID field is modified the request is triggered and performs the background check to the database.
2. if the ID is found, I return the {success: true, valid: true} response.
Can I return the collected data into this response also? That will save me some steps (e.g. {success: true, valid: true, results:[{name: xxx, address:yyy, phone: zzz}] ???
3. If I can't return the collected data into the previous request together with the ajax response I have to populate the form fields (by using for.load('url...')), that's why I need to process the response from your plugin by myself.
Tho, I am not sure how to do that..here;s some sample code:

Well, this is validationplugin and it's basic purpose is field validation. You could put your callback function to rvOptions and you could implement the functionality you describe in that callback but it seem quite awkward and overcomplicated to me.

The straightforward solution would be to listen to field's keyup event (or an another one), send request and process result. If you need this functionality in more than one form, create an extended class for it.

onBlur added

Saki

You said it was OK to add some functions, right?! Here's one I wanted to share, might not mean a lot to you pro's but perhaps for some newbies like me ...

My requirement was e.g. filling in several e-mail addresses in one field and having that checked by the server. But with the 500 milliseconds delay, one could hardly type anything in the field without the server validation firing (whenever a slow user hesitated or so).

So I set the delay to a higher value but then wanted to have the remote validation fire immediately on blur.

Now that's an other matter

I did indeed test it, Saki.
It looks OK in my test configuration. Firebug doesn't complain.
But then again, I'm a total noob in JS programming so I'm afraid you cannot take my word for it, sorry.
But it looks pretty straightforward doesn't it?!