Documentation
-
shortcodes
You will configure the form using shortcodes
The available shortcodes are:* [db_form] – Encloses your form.
* [input]
* [mail]
* [hidden]
* [textarea]
* [radio]
* [select]
* [checkbox]
* [submit]Each of those shortcodes, except [db_form], can handle specific attributes. Those attributes are:
* label
* value
* name
* requiredSpecial attribute for [radio] and [select] is:
* descriptionlabel
This will be the label which will be returned infront of input fields, behind radio buttons and checkboxes and on the submit button
Any caption can be used.
Default: NULLvalue
Specify this attribute to either give input fields a standard text or to define the submit values of radio buttons and checkboxes
Any caption can be used.
Default: NULLname
The name attribute specifies in which column in your mySQL database the value should be submitted.
Any caption can be used.
Default: NULLImportant:
The name-attribute needs to be identical with the column name in your mySQL database
Note:
Don’t use spaces neither within your name-attribute nor as your mySQL column name.
This plugIn is not tested with spaces within the name-attribute.
requiredUse this attribute to set whether the field is required or not.
Takes only true and false as values.
Default: falsedescription
This attribute can only be used with the [radio] and [select] shortcodes.
It can be used to put a text in front of your radio buttons / select dropdown.
Default: NULLshortcode example usage
example 1
Form to submit firstname, lastname and an e-mail adress.
Firstname and e-mail are required lastname isn’t.
E-Mail field will have the default value “[email protected]”[db_form]
[input label=”Firstname *” name=”sql_firstname” required=”true”]
[input label=”Lastname” name=”sql_lastname” ]
[mail label=”E-Mail *” value=”[email protected]” name=”sql_mail” required=”true”]
[submit label=”Send!”]
[/db_form]example 2
Form to submit the answer to 2 questions and an e-mail adress.
Everything is required.[db_form]
[radio description=”Choose your gender. *” label=”Male;Female” value=”m;f” name=”sql_gender” required=”true”]
[radio description=”What’s the right answer to 2+2? *” label=”3;7;4;2″ value=”3;7;4;2″ name=”sql_math” required=”true”]
[mail label=”E-Mail *” name=”sql_mail” required=”true”]
[submit label=”Transmit data.”]
[/db_form]example 3
Form to submit 2 text fields and the value of a checkbox.
Only the checkbox is required.[db_form]
[input label=”Your location” name=”sql_location”]
[input label=”Your destination” name=”sql_destination”]
[checkbox label=”I’d love to use your plugIn” value=”yes” name=”sql_use” required=”true”]
[submit label=”Submit my choice.”]
[/db_form]Note:
The checkbox-shortcode can also work as an enclosing element. That’s especially useful whenever you want to use a lot of code or even HTML markup behind your checkbox.
[checkbox value=”yes” name=”sql_use” required=”true”]I’d love to use your plugIn[/checkbox]mail message examples
You can set up custom mail and mail confirmation messages including the values submitted by the frontend-user.
To do so you have to use the field’s name-attribute enclosed in “%”.
In addition to that you can use full HTML markup.See the examples below.
example 1
Corresponding to shortcode example 1
Firstname: %sql_firstname%
Lastname: %sql_lastname%
E-Mail: %sql_mail%The mail you receive will look like this:
Firstname: user’s firstname
Lastname: user’s lastname
E-Mail: user’s e-mailexample 2
Corresponding to shortcode example 2
Your user’s gender is %sql_gender%
and he/she believes that %sql_math% is correct.
Contact him/her by mail: %sql_mail%The mail you receive will look like this:
Your user’s gender is m
and he/she believes that 4 is correct.
Contact him/her by mail: [email protected]
- The topic ‘Documentation’ is closed to new replies.