{"id":250,"date":"2012-02-10T11:28:24","date_gmt":"2012-02-10T11:28:24","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=250"},"modified":"2024-05-16T06:14:40","modified_gmt":"2024-05-16T05:14:40","slug":"submit-button","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/html\/forms-html\/submit\/submit-button","title":{"rendered":"Submit Button"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>&lt;input type=\"submit\" value=\"SEND\" name=\"btnSubmit\" \/&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Styling <\/h4>\n\n\n\n<p>See <a href=\"\/cloud\/css\/forms-css\/submit-button-2\">here<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Using An Image For The Button <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\t&lt;input type=\"image\" src=\"images\/my_button.png\" alt=\"Call\" name=\"submit\" \/&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Multiple Submit Buttons<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Using the button name parameter<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>if (isset($_POST&#91;'MyButton1']) &amp;&amp; ($_POST&#91;'MyButton1'] != Null))\n{\n}\nif (isset($_POST&#91;'MyButton2']) &amp;&amp; ($_POST&#91;'MyButton2'] != Null))\n{\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>  &lt;form id=\"MyForm\" action=\"http:\/\/www.mydomain.com\/some_file.php\" method=\"POST\"&gt;\n    &lt;input type=\"submit\" name=\"MyButton1\" value=\"Save Message\" \/&gt;      \n    &lt;input type=\"submit\" name=\"MyButton2\" value=\"DISPLAY IT\" \/&gt;\n  &lt;\/form&gt;<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Using the buttons &#8220;value&#8221;<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nif ((isset($_POST&#91;'submit_button_action'])) &amp;&amp; ($_POST&#91;'submit_button_action'] == 'Save Message'))\n{\n\t\/\/----- FORM SAVE MESSAGE -----\n\techo \"Save &lt;br \/&gt;\";\n}\nelse if ((isset($_POST&#91;'submit_button_action'])) &amp;&amp; ($_POST&#91;'submit_button_action'] == 'DISPLAY IT'))\n{\n\t\/\/----- FORM DISPLAY MESSAGE -----\n\techo \"Display &lt;br \/&gt;\";\n}\n?&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>  &lt;form id=\"MyForm\" action=\"http:\/\/www.mydomain.com\/some_file.php\" method=\"POST\"&gt;\n    &lt;input type=\"submit\" value=\"Save Message\" name=\"submit_button_action\" \/&gt;      \n    &lt;input type=\"submit\" value=\"DISPLAY IT\" name=\"submit_button_action\" \/&gt;\n  &lt;\/form&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Different Value and Button Text<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  &lt;button type=\"submit\" name=\"MyName\" value=\"MyValue\"&gt;My Button Text&lt;\/button&gt;<\/code><\/pre>\n\n\n\n<p>Cancel button<\/p>\n\n\n\n<p>You have to create on, there&#8217;s no standard cancel button<\/p>\n\n\n\n<p>In the form:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    &lt;input type=\"submit\" value=\"Cancel\" name=\"submit_button_action\" \/>\r\n    &lt;input type=\"submit\" value=\"Save\" name=\"submit_button_action\" \/>\r\n  &lt;\/form><\/code><\/pre>\n\n\n\n<p>When handling the form:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  if ((isset($_POST&#91;'submit_button_action'])) &amp;&amp; ($_POST&#91;'submit_button_action'] != 'Cancel'))\r\n  {<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Styling See here Using An Image For The Button Multiple Submit Buttons Using the button name parameter Using the buttons &#8220;value&#8221; Different Value and Button Text Cancel button You have to create on, there&#8217;s no standard cancel button In the form: When handling the form:<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[361],"tags":[],"class_list":["post-250","post","type-post","status-publish","format-standard","hentry","category-submit"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=250"}],"version-history":[{"count":26,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/250\/revisions"}],"predecessor-version":[{"id":4503,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/250\/revisions\/4503"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}