{"id":5783108,"date":"2015-02-12T22:33:40","date_gmt":"2015-02-12T22:33:40","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/documentation-80\/"},"modified":"2016-08-22T16:29:11","modified_gmt":"2016-08-22T16:29:11","slug":"documentation-80","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/documentation-80\/","title":{"rendered":"Documentation"},"content":{"rendered":"<p>shortcodes<\/p>\n<p>You will configure the form using shortcodes<br \/>\nThe available shortcodes are:<\/p>\n<p>* [db_form] &#8211; Encloses your form.<br \/>\n* [input]<br \/>\n* [mail]<br \/>\n* [hidden]<br \/>\n* [textarea]<br \/>\n* [radio]<br \/>\n* [select]<br \/>\n* [checkbox]<br \/>\n* [submit]<\/p>\n<p>Each of those shortcodes, except [db_form], can handle specific attributes. Those attributes are:<\/p>\n<p>* label<br \/>\n* value<br \/>\n* name<br \/>\n* required<\/p>\n<p>Special attribute for [radio] and [select] is:<br \/>\n* description<\/p>\n<p>label<\/p>\n<p>This will be the label which will be returned infront of input fields, behind radio buttons and checkboxes and on the submit button<br \/>\nAny caption can be used.<br \/>\nDefault: NULL<\/p>\n<p>value<\/p>\n<p>Specify this attribute to either give input fields a standard text or to define the submit values of radio buttons and checkboxes<br \/>\nAny caption can be used.<br \/>\nDefault: NULL<\/p>\n<p>name<\/p>\n<p>The name attribute specifies in which column in your mySQL database the value should be submitted.<br \/>\nAny caption can be used.<br \/>\nDefault: NULL<\/p>\n<p>Important:<br \/>\nThe name-attribute needs to be identical with the column name in your mySQL database<br \/>\nNote:<br \/>\nDon&#8217;t use spaces neither within your name-attribute nor as your mySQL column name.<br \/>\nThis plugIn is not tested with spaces within the name-attribute.<br \/>\nrequired<\/p>\n<p>Use this attribute to set whether the field is required or not.<br \/>\nTakes only true and false as values.<br \/>\nDefault: false<\/p>\n<p>description<\/p>\n<p>This attribute can only be used with the [radio] and [select] shortcodes.<br \/>\nIt can be used to put a text in front of your radio buttons \/ select dropdown.<br \/>\nDefault: NULL<\/p>\n<p>shortcode example usage<\/p>\n<p>example 1<\/p>\n<p>Form to submit firstname, lastname and an e-mail adress.<br \/>\nFirstname and e-mail are required lastname isn&#8217;t.<br \/>\nE-Mail field will have the default value &#8220;xx@yy.zz&#8221;<\/p>\n<p>[db_form]<br \/>\n[input label=&#8221;Firstname *&#8221; name=&#8221;sql_firstname&#8221; required=&#8221;true&#8221;]<br \/>\n[input label=&#8221;Lastname&#8221; name=&#8221;sql_lastname&#8221; ]<br \/>\n[mail label=&#8221;E-Mail *&#8221; value=&#8221;xx@yy.zz&#8221; name=&#8221;sql_mail&#8221; required=&#8221;true&#8221;]<br \/>\n[submit label=&#8221;Send!&#8221;]<br \/>\n[\/db_form]<\/p>\n<p>example 2<\/p>\n<p>Form to submit the answer to 2 questions and an e-mail adress.<br \/>\nEverything is required.<\/p>\n<p>[db_form]<br \/>\n[radio description=&#8221;Choose your gender. *&#8221; label=&#8221;Male;Female&#8221; value=&#8221;m;f&#8221; name=&#8221;sql_gender&#8221; required=&#8221;true&#8221;]<br \/>\n[radio description=&#8221;What&#8217;s the right answer to 2+2? *&#8221; label=&#8221;3;7;4;2&#8243; value=&#8221;3;7;4;2&#8243; name=&#8221;sql_math&#8221; required=&#8221;true&#8221;]<br \/>\n[mail label=&#8221;E-Mail *&#8221; name=&#8221;sql_mail&#8221; required=&#8221;true&#8221;]<br \/>\n[submit label=&#8221;Transmit data.&#8221;]<br \/>\n[\/db_form]<\/p>\n<p>example 3<\/p>\n<p>Form to submit 2 text fields and the value of a checkbox.<br \/>\nOnly the checkbox is required.<\/p>\n<p>[db_form]<br \/>\n[input label=&#8221;Your location&#8221; name=&#8221;sql_location&#8221;]<br \/>\n[input label=&#8221;Your destination&#8221; name=&#8221;sql_destination&#8221;]<br \/>\n[checkbox label=&#8221;I&#8217;d love to use your plugIn&#8221; value=&#8221;yes&#8221; name=&#8221;sql_use&#8221; required=&#8221;true&#8221;]<br \/>\n[submit label=&#8221;Submit my choice.&#8221;]<br \/>\n[\/db_form] <\/p>\n<p>Note:<br \/>\nThe checkbox-shortcode can also work as an enclosing element. That&#8217;s especially useful whenever you want to use a lot of code or even HTML markup behind your checkbox.<br \/>\n[checkbox value=&#8221;yes&#8221; name=&#8221;sql_use&#8221; required=&#8221;true&#8221;]I&#8217;d love to use your plugIn[\/checkbox]<\/p>\n<p>mail message examples<\/p>\n<p>You can set up custom mail and mail confirmation messages including the values submitted by the frontend-user.<br \/>\nTo do so you have to use the field&#8217;s name-attribute enclosed in &#8220;%&#8221;.<br \/>\nIn addition to that you can use full HTML markup.<\/p>\n<p>See the examples below.<\/p>\n<p>example 1<\/p>\n<p>Corresponding to shortcode example 1<\/p>\n<p><strong>Firstname:<\/strong><strong> %sql_firstname%<br \/>\n<\/strong><strong>Lastname:<\/strong><strong> %sql_lastname%<br \/>\n<\/strong><strong>E-Mail:<\/strong><strong> %sql_mail%<\/p>\n<p>The mail you receive will look like this:<\/p>\n<p>Firstname: user&#8217;s firstname<br \/>\nLastname: user&#8217;s lastname<br \/>\nE-Mail: user&#8217;s e-mail<\/p>\n<p>example 2<\/p>\n<p>Corresponding to shortcode example 2<\/p>\n<p>Your user&#8217;s gender is <\/strong><strong>%sql_gender%<\/strong><strong><br \/>\nand he\/she believes that <\/strong><strong>%sql_math%<\/strong><strong> is correct.<br \/>\nContact him\/her by mail: <a>%sql_mail%<\/a><\/p>\n<p>The mail you receive will look like this:<\/p>\n<p>Your user&#8217;s gender is m<br \/>\nand he\/she believes that 4 is correct.<br \/>\nContact him\/her by mail: mail@mail.mail<\/strong><\/p>\n<p>https:\/\/wordpress.org\/plugins\/db-form\/<\/p>\n","protected":false},"template":"","class_list":["post-5783108","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5783108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5783108\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=5783108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}