Mfrwc: Difference between revisions

From SWCP Support Wiki
Jump to navigationJump to search
No edit summary
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
The setup for '''mfrwc''' is the same as [[mail-form-results]], with two additional sections.
First read the information on [[mail-form-results]] for detailed description of all the
necessary field names. Below are the additional fields and include files that you'll
need for using mfrwc (Mail form results with CAPTCHA). Please note that this form
will require '''your website users to have Javascript enabled''' in order to work,
and if you're using this with your own domain, you'll need to have us install the
captcha module for you.
 
==Including the Javascript File (from pages.swcp.com/~username)==
In the HEAD section of your HTML you need to include a Javascript file. See below:
In the HEAD section of your HTML you need to include a Javascript file. See below:


   <script language="JavaScript" type="text/javascript"  
  <PRE>
           src="http://captcha.swcp.com/ajax_captcha.js">
   &lt;script language="JavaScript" type="text/javascript"  
   </script>
           src="http://captcha.swcp.com/ajax_captcha.js"&gt;
  &lt;/script&gt;
  </PRE>
 
==Including the Javascript File (from ''www.yourdomain.com'')==
After we've installed the captcha scripts for you.
 
  <PRE>
   &lt;script language="JavaScript" type="text/javascript"
          src="ajax_captcha.js"&gt;
  &lt;/script&gt;
  </PRE>


At the end of your form replace the Submit button with the following code:
==Action Buttons==
   <style = "text/style">
===Generating the CAPTCHA picture===
The CSS is to indent the CAPTCHA and draw a thin black line around it. This is completely optional.
====CSS====
   <PRE>
  &lt;style = "text/style"&gt;
   #imgCaptcha { margin: 0 30px; border: black solid 1px; }
   #imgCaptcha { margin: 0 30px; border: black solid 1px; }
   </style>
  &lt;/style&gt;
   <img id="imgCaptcha" src='/cgi-bin/gencap.pl?789'><br><br>
   </PRE>
====Picture and input field (from pages.swcp.com)====
   <PRE>
  &lt;img id="imgCaptcha" src='/cgi-bin/gencap.pl?789'&gt;&lt;br>&lt;br&gt;
 
  Please type in the letters above
        &lt;input id="txtCaptcha" type="text" name="verify" size=8
                onKeyPress="onlyOnReturn(event, document.mfrwc)"; &gt;&lt;br&gt;
  </PRE>
 
====Picture and input field (from ''yourdomain.com'')====
  <PRE>
  &lt;img id="imgCaptcha" src='/username-bin/gencap.pl?789'&gt;&lt;br>&lt;br&gt;
 
   Please type in the letters above
   Please type in the letters above
         <INPUT id="txtCaptcha" TYPE="text" name="verify" size=8
         &lt;input id="txtCaptcha" type="text" name="verify" size=8
                 onKeyPress="onlyOnReturn(event, document.mfrwc)"; ><br>
                 onKeyPress="onlyOnReturn(event, document.mfrwc)"; &gt;&lt;br&gt;
   <INPUT id="regCaptcha" type="button" value="Give me different text"
  </PRE>
         NAME="regCaptcha" onclick="regenCaptcha(document.mfrwc)"; >
 
   <INPUT id="btnCaptcha" type="button" value="Send Comments"
where username-bin is your cgi-bin alias.
         NAME="btnCaptcha" onclick="getParam(document.mfrwc)"; >
 
   <INPUT TYPE="reset" VALUE="Clear Form">
===A button to get a new CAPTCHA===
   <DIV id="response"> &nbsp </DIV>
This is in case the generated CAPTCHA isn't readable by the client, they can
use this to get a different one. This is an optional button.
  <pre>
   &lt;input id="regCaptcha" type="button" value="Give me different text"
         NAME="regCaptcha" onclick="regenCaptcha(document.mfrwc)";&gt;
  </pre>
 
===Submit Replacement===
This is required. Do not change the id or name of this button.
   <pre>
  &lt;input id="btnCaptcha" type="button" value="Send Comments"
         name="btnCaptcha" onclick="getParam(document.mfrwc);"&gt;
  </pre>
 
===Clear Form Button===
This is also optional.
   <PRE>
  &lt;input type="reset" value="Clear Form"&gt;
  </PRE>
 
===Status Area===
This empty DIV is needed to display an error message when the user types in an
incorrect CAPTCHA text.
   <pre>
  &lt;div id="response"&gt; &nbsp &lt;/div&gt;
  </pre>
 


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.
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
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 for use with pages.swcp.com/~username]]
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.
[[MFRWC Domain Example|Complete example with all necessary variables for use with www.yourdomain.com]]

Latest revision as of 14:57, 28 May 2009

First read the information on mail-form-results for detailed description of all the necessary field names. Below are the additional fields and include files that you'll need for using mfrwc (Mail form results with CAPTCHA). Please note that this form will require your website users to have Javascript enabled in order to work, and if you're using this with your own domain, you'll need to have us install the captcha module for you.

Including the Javascript File (from pages.swcp.com/~username)

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>
   

Including the Javascript File (from www.yourdomain.com)

After we've installed the captcha scripts for you.

  <script language="JavaScript" type="text/javascript" 
           src="ajax_captcha.js">
  </script>
   

Action Buttons

Generating the CAPTCHA picture

The CSS is to indent the CAPTCHA and draw a thin black line around it. This is completely optional.

CSS

  <style = "text/style">
  #imgCaptcha { margin: 0 30px; border: black solid 1px; }
  </style>
  

Picture and input field (from pages.swcp.com)

  <img id="imgCaptcha" src='/cgi-bin/gencap.pl?789'><br><br>
  
  Please type in the letters above
         <input id="txtCaptcha" type="text" name="verify" size=8
                 onKeyPress="onlyOnReturn(event, document.mfrwc)"; ><br>
  

Picture and input field (from yourdomain.com)

  <img id="imgCaptcha" src='/username-bin/gencap.pl?789'><br><br>
  
  Please type in the letters above
         <input id="txtCaptcha" type="text" name="verify" size=8
                 onKeyPress="onlyOnReturn(event, document.mfrwc)"; ><br>
  

where username-bin is your cgi-bin alias.

A button to get a new CAPTCHA

This is in case the generated CAPTCHA isn't readable by the client, they can use this to get a different one. This is an optional button.

  <input id="regCaptcha" type="button" value="Give me different text"
         NAME="regCaptcha" onclick="regenCaptcha(document.mfrwc)";>
  

Submit Replacement

This is required. Do not change the id or name of this button.

  <input id="btnCaptcha" type="button" value="Send Comments"
         name="btnCaptcha" onclick="getParam(document.mfrwc);">
  

Clear Form Button

This is also optional.

  <input type="reset" value="Clear Form">
  

Status Area

This empty DIV is needed to display an error message when the user types in an incorrect CAPTCHA text.

  <div id="response"> &nbsp </div>
  


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 for use with pages.swcp.com/~username 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.

Complete example with all necessary variables for use with www.yourdomain.com