Home > Form Elements > Submit
In Brief: Submit the form page.
Dependencies: One or more form elements on a finished page.
Hints & Tricks: Protect your forms with 4 types of anti-spam Captcha.
Want to use an image based submit button? Please see here for information on how to do this!
Basic Attributes
The text your button displays.
This field only becomes important if you have more than one submit button on the form, in that you are using the Submit Route feature. As a general rule, you should keep your Name/Value and id the same for your buttons.
Please see Name/Value above.
The Submit Route text field lets you create custom form routing, in that the value of this field will be the page your user goes to if the form submission was successful.
The most common use of this would be to create a form where you need to provide users with an 'optional' part of your form. For example, your form asks for the current users information on page 1, but also has a submit button that allows users to enter a 'friends' information. The friend portion is optional however, so you also want users to simply skip ahead to the next part of the form if they so choose.
Thus, we would build page 1 with two submit buttons:
Submit Button 1 would be called 'Submit' and have no value for the Submit Route text box; When clicked, this button follows the value from the Page Properties On Success property, the on Success property being page3.php. It's because this button has no value in the Submit Route text box that this default behavior is observed.
The second button would be called 'Add Friend' and have a value of page2.php. That means when clicked on, the user is taken to the optional, second page of the form. They could then add the friends info, and when they click submit on that page, would be routed back to page3.php.
Every field element in RackForms is wrapped in either a LI or DIV element for Sortable or Free Form page types, respectively. When you place a value in this box it becomes the class="" attribute for that wrapper. Because a wrapper encompass both the input element and wrapper, you can use this value to show and hide sections of your form.
Add code to your field item by typing it into this box. Code can be JavaScript event code such as:
onclick="alert('Be sure to use Letters only');"
External Library dependent code as in:
onclick="Effect.Fade(this, { duration:.2});" (Prototype/Scriptaculous shown here)
Or Style definitions as in:
style="color:#cdcdcd;"
What's important to note is that the code you create here effects the field element, not the container it sits in. To edit the field container, you need to reference the field name prefixed with 'fb_fld-', as in a text box with an ID of text1 would be referenced like:
fb_fld-text1
Conditional Processing
Conditional Processing for submit buttons is the act of directing a user to different pages based on their responses to our forms questions. RackForms is particularly powerful in this regard as testing and acting on such conditions is handled using a simplified PHP code syntax. This means we can create just about any logic we need to handle our forms workflow, but it doesn't require complex programming knowledge.
At the most basic level each form field element we create is assigned a unique Name/Value property. This Name/Value property differentiates this form item from others, and because it is unique, is the key to creating conditional logic.
For example, if we create a text box and assign it a Name/Value of pet_preference, we can use that pet_preference identifier in our Conditional Code statement to route users to a particular form page when they hit submit based on their response that that form field.
Of course this example only makes sense if we have unique pages to go to, so for this example we'll create a three-page form. The first page will hold our text box with the pet_preference text box, the second and third pages will be named cat.php and dog.php, respectively.
Now we'll create our Conditional Logic on the first page's submit button as follow:
if(#{pet_preference} == 'Cats'){ goto ${cat.php}; } if(#{pet_preference} == 'Dogs'){ goto ${dog.php}; }
As you can see, the syntax isn't that difficult--we simply ask if a a field is equal to some value and then goto that page if it is. PHP developers will recognize this syntax immediately, though you will also notice the use of tokens #{} and the goto. The tokens are replaced with the field value at runtime, the goto is replaced with a simple header() call.
This is what is meant by 'simplified syntax'. The full PHP arsenal is at our disposal, but we needn't become bogged down by overly complex code structure and identifiers. Anytime we need to check on a form variable we use the token, when we want to go to a page we use goto and insert the page name, also in token format.
Determines if this field is initially visible to your forms users.
This is the code that will be run when the submit button is pressed by the user. It is directly tied to the select items directly beneath, in that when you want to insert a field or page token we simply select one from the two lists.
If you need to check an array value, as you would for checkboxes, you would add the appropriate index position with a [n]. For example, a checkbox at position 1 would be:
if(#{checkbox1[1]} == 'Yes'){ .... }
Similar to Insert Field List, only this item will insert a page token to be used with the goto keyword.
Custom CSS
moz-border-bottom-colors: none;
-moz-border-image: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
cursor: pointer;
background: none no-repeat 0 0 #F6F6F6;
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
border-style: solid;
border-width: 1px;
color: #F2F2F2;
display: inline-block;
font-family: "myriad-pro-1","myriad-pro-2",sans-serif;
font-size: 25px;
font-weight: bold;
height: 52px;
letter-spacing: -0.5px;
margin-top: 10px;
padding: 0;
text-shadow: -1px -0.5px 1px
rgba(0, 0, 0, 0.8);
width: 180px;
text-decoration: none;
/* backgrounds */
-moz-box-shadow: 0 0 7px #acebff !important;
-webkit-box-shadow: 0 0 7px
#ACEBFF !important;
box-shadow: 0 0 7px
#ACEBFF !important;
background:
#85BC13;
background: -moz-linear-gradient(top,
#85BC13 0%,
#5AA615 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,
#85BC13), color-stop(100%,
#5AA615));
background: -webkit-linear-gradient(top,
#85BC13 0%,
#5AA615 100%);
background: -o-linear-gradient(top,
#85BC13 0%,
#5AA615 100%);
background: -ms-linear-gradient(top,
#85BC13 0%,
#5AA615 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#85BC13', endColorstr='#5AA615',GradientType=0 );
background: linear-gradient(top,
#85BC13 0%,
#5AA615 100%);
The key is this code is never wrapped in braces or uses a selector, as RackForms takes care of that for us. We only add raw CSS code.
The neat trick here is as focus happens when we click or tab to an element, we can create a "clicked" animation for our element by supplying a style different from the Over/Hover and Normal state.
Validation
Select from: No CAPTCHA, Default CAPTCHA, reCAPTCHA, 3D Captcha, or Challenge Question.
gd
gd_info
imagettfbbox
The message to show users if the captcha element is not filled out correctly. Defaults to: Security answer incorrect, please try again., though you may wish to change it to better match the captcha type.
# Characters
By default the captcha block requires 5 characters to be deciphered and typed in correctly by the end-user to validate. You can change this however, with a numeric value of your choice.
Image Width / Image Height
The width and height of the captcha block.The text color of the Enter Code copy.
The text to display next to the captcha input field. Defaults to English with a value of: Enter Code:
reCAPTCHA uses a feature rich external interface to generate captcha codes. This is a great choice for broad audiences, as reCAPCHA uses audio as well as text. This may also be a better solution for Windows server users, as their are known bugs with font handling on those systems with regard to the Default and 3D Captcha Methods.
The first way is to simply supply the values in the Editor text boxes.
The second way is to hard-code the values into the /app/movefiles/security/secure.php file. Open this file in a text editor and look for the lines:
$publickey = '';
$privatekey = '';
Supply your key values into the variable like so:
$publickey = '3LtoMwQSDWERAKPF1dDEud-Jo5cIbzw15B4aZ7WB';
$privatekey = 6LtoCwQYEHDBDDKPF1dDEud-Ja7crtdfw15B4aZ7WB';
Notice how we place the key text in between the tick marks.
If you provide these elements correctly, when you export a form that uses reCAPTCHA, you will see a UI element that looks very similar to the RackForms editor appear on your form.
This option lets us select one of the styles reCaptcha supports. See them in your own test form, or here.
Challenge Captcha Options (Build 623 and up)
Challenge Captcha is a text based question/answer system that requires users to reply to a text-based question with the correct answer. This type of challenge, while incredibly simple, is often the most effective as with a suitable question it effectively eliminates bots from completing your form.
Of course this only works if you make your question hard enough so that it's not easy to spam the answer (do not use questions that can be answered with numbers, for example), and you change the question on a regular basis for popular forms that could become targets of SPAM bots (your form could be cracked by a human and then a SPAM bot is programmed to know the correct answer).
This is the question to ask of your user. Make sure to include any hints on how to answer the question.
This is the exact answer to your challenge question. Make sure the spelling and capitalization is easy to guess!
This is the color of the text your challenge question will be presented in.
This option uses Google's newest version of reCAPTCHA, and is highly recommended for its simplicity and security. It requires a site key and secret, both of which can be created here. Please note this feature will not be available if your server is running a PHP version older than 5.2.
In 2007 we had a simple idea: make building web forms fun and easy, and most importantly available to as many users as possible. Years later we're still going strong and though the software has grown by leaps and bounds, still find building forms as easy as we had hoped.