captcha javascript

NateMail, ProcessForm, JavaScript Form Validator, Form Security, etc.

captcha javascript

Postby snip » 02/21/2009 @ 11:53

Good morning, all. Been a long time since I've come here... glad to see it's still active!

I am in the process of creating an 'all the bells and whistles Nate offers' form template, and have run into a minor snag: I am using ProcessForm 3.0.15, the default form values javascript (MPLoadDefaults, ect), basic validation via http://docs.jquery.com/Plugins/Validation, and CAPTCHA Security Image (2.1). Everything is working well so far.

The problem: I am wanting to validate the CAPTCHA prior to submission via Javascript, but since I already have an onsubmit value, I am unclear on how to do this.. I have no abilities per se with Javascript (tho I am a reasonably accomplished cut/paste cobbler).

I did a search on the forum ("captcha javascript" )and though there are some tantalizing clues in the results... nothing I understand enough to actually get the job done.

Help?
snip
 
Posts: 34
Joined: 09/19/2006 @ 16:32

Re: captcha javascript

Postby Nate Baldwin » 02/23/2009 @ 14:43

Can you post (or use the contact form to send me) a link to your form page, or paste in the JavaScript you're already using on the form? From that, I should be able to tell you what to add to include the captcha.
Nate Baldwin
Site Admin
 
Posts: 3724
Joined: 04/25/2003 @ 19:05

Re: captcha javascript

Postby snip » 02/23/2009 @ 15:04

Thanks, Nate... sent along a .zip of the validation JS.
snip
 
Posts: 34
Joined: 09/19/2006 @ 16:32

Re: captcha javascript

Postby Nate Baldwin » 02/23/2009 @ 15:24

Got it - thanks. After looking at the files you sent, I guess the real question is, how is the other onsubmit script being added? Is it in the form tag, something like:
Code: Select all
<form action="whatever" ...(more stuff)... onsubmit="SomeOtherScript()">

If so, you can add the extra function call to the same onsubmit event by separating them with a semicolon, like:
Code: Select all
<form action="whatever" ...(more stuff)... onsubmit="SomeOtherScript(); return MPFSValidate()
;">

...and I _think_ that'll work to check the captcha as a separate process. Don't know how to integrate it directly into the other jQuery script to where it does all the validation at the same time though, and wouldn't recommend changing the jQuery js files. Could also switch the order if you want the captcha to be checked first, just be sure to include the "return" part before the function call so it cancels the form submission if it's not correct.

Otherwise, post back if I misunderstood and I'll take another look.
Nate Baldwin
Site Admin
 
Posts: 3724
Joined: 04/25/2003 @ 19:05

Re: captcha javascript

Postby snip » 02/23/2009 @ 15:34

OK... tried what you suggested:
Code: Select all
<form action="forms/ProcessForm.php" method="post" id="contact" name="contact" onsubmit="return MPFSValidate(); MPClearAll();">


It validates "sort of": returns an error every time... whether or not there is actually an error.
snip
 
Posts: 34
Joined: 09/19/2006 @ 16:32

Re: captcha javascript

Postby snip » 02/23/2009 @ 15:37

sorry... didn't fully answer your prior question: the validation script is 'real time'... it validates as you fill the form. If you pass a field that is required, it places a warning message at that field. So it is not onsubmit, per se.
snip
 
Posts: 34
Joined: 09/19/2006 @ 16:32

Re: captcha javascript

Postby snip » 02/23/2009 @ 15:53

FYI, the fact that there might be two onsubmit events has no bearing. This code:
Code: Select all
<form action="forms/ProcessForm.php" method="post" id="contact" name="contact" onsubmit="return MPFSValidate();">


(which does not have the 'other' onsubmit event) has the same result: every submission attempt generates an error.
snip
 
Posts: 34
Joined: 09/19/2006 @ 16:32

Re: captcha javascript

Postby Nate Baldwin » 02/23/2009 @ 15:55

Do you have the form online somewhere? Can you send me a link so I can see what it's doing and what else is in the page?
Nate Baldwin
Site Admin
 
Posts: 3724
Joined: 04/25/2003 @ 19:05

Re: captcha javascript

Postby snip » 02/23/2009 @ 15:56

well.. not quite an 'error'. I get the javascript popup telling me I have not filled in the correct value for the security script... and that is (or can be) an incorrect response. I get that response regardless of the accuracy of the value submitted.
snip
 
Posts: 34
Joined: 09/19/2006 @ 16:32

Re: captcha javascript

Postby snip » 02/23/2009 @ 16:56

Nate Baldwin wrote:Do you have the form online somewhere? Can you send me a link so I can see what it's doing and what else is in the page?


sent off-list
snip
 
Posts: 34
Joined: 09/19/2006 @ 16:32

Re: captcha javascript

Postby tiffanly » 08/06/2009 @ 00:40

How do you turn on Javascript? I am trying to watch videos on youtube and it keeps telling me that I need to turn on Javascript. How do you turn on Javascript? Please make your answers easy to understand because im not a computer person.
tiffanly
 
Posts: 1
Joined: 08/04/2009 @ 00:07

Re: captcha javascript

Postby oavs » 08/12/2009 @ 20:53

tiffanly wrote:How do you turn on Javascript? I am trying to watch videos on youtube and it keeps telling me that I need to turn on Javascript. How do you turn on Javascript? Please make your answers easy to understand because im not a computer person.


This has nothing to do with Form Processor. It is quite simple actually. If you type the same question in the Google search bar 'How do you turn on Javascript?' you'll get 77,300,000 answers. Take your pick.
:-)
oavs
 
Posts: 55
Joined: 07/06/2004 @ 02:24

Hi,

Postby William1 » 08/20/2009 @ 01:07

Really breathtaking further informative topic. Thank you seeing sharing this.
Thank you for sharing.
William1
 
Posts: 1
Joined: 08/20/2009 @ 00:54


Return to Form Processing (NateMail, ProcessForm)



Who is online

Users browsing this forum: Exabot [Bot] and 1 guest

cron