Geoforms is a WordPress plugin which makes it easy to create and manage forms.
This plugin avoids problems that plague other wordpress forms plugins for one simple reason: the forms and form fields are created and stored separately. Instead of being tied to forms, the fields are tied to the data. This allows you to add any field to as many forms as you like. You can then use the same field in that same form, or the same field in any another form, to update the same data.
Other features that make this plugin unique:
You can add fields in bulk amounts.
You can easily create forms which are based on the results of other forms.
- Upload the
/geoforms/directory to the
- Activate the plugin through the \’Plugins\’ menu in WordPress
How do I create a form?
In the WordPress admin, choose “GeoForms” from the menu on the left. On the GeoForms admin page, choose the “forms” tab.
Add a form name under “Create a New Form” and press “submit”.
How do I create fields?
On the GeoForms admin page, choose the “fields” tab. Optionally create a field category, or choose a previously created category. Under “Create New Fields” choose the type of element you want to create. Under “New Field Titles” add the titles of the fields you want to add. Each line will be used as the title of a new field. If you are adding radio buttons, each line will be used as the title of a new radio button. For additional information about adding radio buttons, see “How can I add radio buttons?”
How can I display a form?
You can add a form to a WordPress page with a shortcode.
The name of the form can either be the form slug that you entered into the form, or the form id.
If the name of the form matches the slug for the page, you can leave out the form id [geoform]
If you want to have the form post to another page, add an action attribute [geoform action=”myotherpage”]
Why should I create field categories?
Field categories allow you to limit your list of fields when displaying the fields in the Geoforms admin, and also when displaying the data created by those fields. You can also associate each form with a field category. When you select that form in the forms tab, the associated category is also selected in the fields tab.
However, please note, when you select a field category in the fields tab, it doesn’t change the selected form. In other words, you can browse to any category while keeping the same form. This allows you to add any field from any category to any form. This is a very important feature of geoforms.
How can I add radio buttons?
Choose “radio buttons” from the type of element dropdown in the “Create New Fields” section of the “Fields” tab. To add new buttons, simply add a list of radio button names to the “New Field Titles” text area. By default, each line will be used as the title of a new radio button.
Your buttons will need titles for the fields and also for each button. You can add the field names along with the buttons by adding them before the buttons and enclosing them in square brackets.
If you don’t add any field names, they are displayed in the admin with the name of the first button in the field as the field name. You can then add the field name when you edit that field.
How can I add bulk groups of radio buttons?
Adding the field names along with the button allows you to add many radio button fields at once.
For example, to create two radio button fields with three button each follow this example: [Radio Field #1] button one button two
button three [Radio Field #2] button one button two
You radio buttons will need default values. This is the value that will be returned by the form when the button is selected.
There are three ways to add default values. You can list them in the default values box when you create the field. In the example above, you could use this example: value_one value_two value_three
In that case, each radio button in both fields will have the value corresponding to their position in the default values box.
Alternatively, you can check the “Create default values from field Titles” box and machine name default values will be created for you.
in the above example it would create these values button_one button_two button_three
You can also add or and change the default values to anything you like in the edit field section after the buttons are created.
How do I add a default value to a radio button group?
Each radio button has a field for the value of that button. You can have one of those buttons selected by default by entering the value for that button into the default value field.
The default value will only be selected when there is no previous selection in the database.
How do I add a field to a form?
First go to the “Forms” tab and select a form. Then go to the “Fields” tab and create a field or if its already been created, select the category that your field is in. Find your field in the list of fields and select the “Add to form” button. If you go back to the “Forms” tab, you will see that your field is now listed in the selected form.
How do I edit/customize data as it is entered?
Create a function with the name geoFormsCustomRequestFilter and add it to your functions.php file. This function should
take the request array and return the altered request array. Make any changes to any of the requested fields, or add
or delete fields in the body of the function. GeoForms will call this funciton automatically everytime a form is posted.
How do I add text before and after a field?
After you create a field, there are areas for before and after descriptions. Check the “add HTML” boxes next to each field where you would like geoforms to add paragraph tags to the text when the field is displayed on the front end. (The “add HTML” feature doesn’t not anything else, it simply adds paragraph tags.) Or leave those boxes unchecked and add your own HTML.
To insert your field into an inline sentence, add a begining block tag into the last line of the description. Then Add the beginning of your sentence. Then, in the beginnin of the “After description” box, add the last part of the sentence that goes after your field along with an end tag.
Why do my description fields have extra line breaks?
This is probably because you have added html to your text and also checked the “add html” checkbox. This causes the form to wrap your paragraph tags in additional paragraph tags. Either add HTML or check the box, but don’t do both.
How to I create an extra section between fields without adding another field element?
Make a field as you would any other field. In the “Type of Element” column, choose “text/html”,
then add the text or html for that section into the description box.
How can I display a form on a PHP page?
Forms are displayed using a simple Model-View-Controller pattern.
This is how most form pages will look:
$View = new GeoFormsView($Model);
Lets go thru that code in detail so you really understand it.
$Model=new GeoForms(“your_form_name”); // The Model
The argument for the Model can be the either the form machine name that was given to the form in the admin for that form, or a form id that is also available in the admin.
new GeoFormsController($Model,$_POST); // The Controller
All forms post to a controller. If the form action posts to the same page, the controller is after the model and before the view. Otherwise, the controller belongs on the page used as the action by the view. You don’t actually need to assign the controller to a variable. Simply calling the controller is enough.
If the model being used by the controller is only being used by the controller, the form id is optional. You could concievably have all your forms use the same controller, but since most forms post to the same page as the form, I don’t usually do it that way.
For example: $Model=new GeoForms();
$View = new GeoFormsView($Model); // The View
echo $View->editValuesForm(‘/your-action/’); Finally, the view actually displays the form. The first argument is the form action. If the action is blank, the form will use the
same page as the action.
How can I create a multipage form?
Multi page forms are really just forms which have been grouped together into 1 superform. To create a superform, first create each form in the forms tab of the admin, just as you would create regular forms. Then go to the Superforms tab, create a superform, and add your forms into the superform.
How can I display a multipage form?
Multi page forms are known as superforms. You can add a superform to a WordPress page with a shortcode.
Get the superform number from the admin section for that superform, then add it to the shortcode like this:
How can I display a superform with PHP?
Superforms are displayed almost the same as regular forms except for these diffences.
1)Instead of using a form id or form name as an argument in the model, you will use tha superform id number which is displayed in the admin for that superform.
2) Instead of entering the id as the first argument for the model, you will enter it as the second argument.
3) The third argument for the model is $_POST[‘formid’]
4) The action for the form is the action of the final form in the superform.
Here is an example showing how to display a superform:
SuperForm1=new GeoForms(null,1,$_POST[‘formid’]);// superform#1
$Controller = new GeoFormsController($SuperForm1,$_POST);
$FormsView = new GeoFormsView($SuperForm1);
How can I get a form to display the values that were previously entered?
Select the form in the forms tab of the admin. Check the box marked “display values”. If you want to display the values, you will probably also want to use updates instead of inserts, so the “insert all values” box should not be checked.
Also please note that when you display the form with $GeoFormsView->editValuesForm(),
you can overide the “display values” attribute with the second argument “$dontAddDefaultValues”.
So if you want to display the values that argument should not be true.
There are no reviews for this plugin.