Mfrwc: Difference between revisions
No edit summary |
No edit summary |
||
| Line 25: | Line 25: | ||
The 'regCaptcha' button is for allowing the form user to regenerate a new text if they can't read the | The 'regCaptcha' button is for allowing the form user to regenerate a new text if they can't read the | ||
one that's presented. | one that's presented. | ||
[[MFRWC Example|Complete example with all necessary variables]] | |||
The values on the INPUT buttons can be changed to anything you'd like. The empty DIV named response is | The values on the INPUT buttons can be changed to anything you'd like. The empty DIV named response is | ||
used to present an error message when the CAPTCHA is incorrectly typed and must be there. | used to present an error message when the CAPTCHA is incorrectly typed and must be there. | ||
Revision as of 14:49, 10 February 2009
The setup for mfrwc is the same as mail-form-results, with two additional sections. In the HEAD section of your HTML you need to include a Javascript file. See below:
<script language="JavaScript" type="text/javascript"
src="http://captcha.swcp.com/ajax_captcha.js">
</script>
At the end of your form replace the Submit button with the following code:
<style = "text/style">
#imgCaptcha { margin: 0 30px; border: black solid 1px; }
</style>
<img id="imgCaptcha" src='/cgi-bin/gencap.pl?789'>
Please type in the letters above
<INPUT id="txtCaptcha" TYPE="text" name="verify" size=8
onKeyPress="onlyOnReturn(event, document.mfrwc)"; >
<INPUT id="regCaptcha" type="button" value="Give me different text"
NAME="regCaptcha" onclick="regenCaptcha(document.mfrwc)"; >
<INPUT id="btnCaptcha" type="button" value="Send Comments"
NAME="btnCaptcha" onclick="getParam(document.mfrwc)"; >
<INPUT TYPE="reset" VALUE="Clear Form">
< DIV id="response" >   < /DIV >
The CSS is to indent the CAPTCHA and draw a thin black line around it. This is completely optional. Note, the ids and the DIV are used by the Captcha scripts and must remain with the same names. The 'regCaptcha' button is for allowing the form user to regenerate a new text if they can't read the one that's presented.
Complete example with all necessary variables The values on the INPUT buttons can be changed to anything you'd like. The empty DIV named response is used to present an error message when the CAPTCHA is incorrectly typed and must be there.