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?
captcha javascript
13 posts
• Page 1 of 1
Re: captcha javascript
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
Thanks, Nate... sent along a .zip of the validation JS.
- snip
- Posts: 34
- Joined: 09/19/2006 @ 16:32
Re: captcha javascript
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:
If so, you can add the extra function call to the same onsubmit event by separating them with a semicolon, like:
...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.
- 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
OK... tried what you suggested:
It validates "sort of": returns an error every time... whether or not there is actually an error.
- 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
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
FYI, the fact that there might be two onsubmit events has no bearing. This code:
(which does not have the 'other' onsubmit event) has the same result: every submission attempt generates an error.
- 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
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
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
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
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
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
13 posts
• Page 1 of 1
Return to Form Processing (NateMail, ProcessForm)
Who is online
Users browsing this forum: No registered users and 1 guest