Hello everyone!
I need to make an Ajax validation form (as I think, I’m new to such things). It looks like a lightbox appearing in front of the page, and it has several fields and captcha. I use SPForm for it, and on "no-js" fallback it works fine.
If js is enabled, I check fields validation on client (actually, I use the SPFoem JS scripts for it), but I need to validate CAPTCHA as well. Can’t figure out how to do it. If I use jQuery plugin like jquery.form.js, it just gets the response from page containing SPForm snippet that everything is ok if I even don’t fill the CAPTCHA field.
The idea is ti make a snippet to check just CAPTCHA and make form action redirect to the page containing this snippet and no template, but I don’t have enough experience to code it yet.
Can you recomment me some tutorials on my issue (about writing captcha validation snippet etc) or provide another solution if I do something wrong?
-
☆ A M B ☆
- 24,524 Posts
Not sure about SPForm, but eForm all by itself on a resource with no template works great as an AJAX request processor. The first click on the "trigger" button or link loads the form, and submitting will return whatever eForm normally returns. It’s just a matter of having your AJAX request use the URL to the resource, and displaying what gets returned.
-
☆ A M B ☆
- 24,524 Posts
That was just by way of example, since it’s what I have actually done. I’m sure that SPForm will do the same, whether in Evo or Revo.
The Captcha add-on sets a $_SESSION variable with the correct answer before it serves up the image ($_SESSION[’veriword’]). Your JS code would have to check that against the user’s input.
You are correct that eForm doesn’t work in Revolution. FormIt is the replacement, though modifying SPForm to do it would also be an option.
If you get it to work in SPForm, please post your code here. If I have time, I might add it to the package.