Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to submit a form when tab is click
    primarykey
    data
    text
    <p>I would like to submit a form, when a tab is clicked. This is what I have so far:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Submit a Form on Tab Click&lt;/title&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;style type="text/css"&gt; &lt;/style&gt; &lt;script&gt; $(function() { $( "#Main" ).tabs(); }); &lt;/script&gt; &lt;script&gt; $(document).ready(function(){ $('#Tab1').click(function(){ $('#Form_1').submit(); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="Main"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#Tab1"&gt;Tab1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#Tab2"&gt;Tab2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#Tab3"&gt;Tab3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#Tab4"&gt;Tab4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#Tab5"&gt;Tab5&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#Tab6"&gt;Tab6&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;form id="Form_1" action="Tab_Click_v00.html" method="post"&gt; &lt;input type="hidden" name="Nb_var99" value="1"&gt; &lt;/form&gt; &lt;div id="Tab1"&gt; &lt;p&gt;Tab1&lt;/p&gt; &lt;/div&gt; &lt;div id="Tab2"&gt; &lt;p&gt;Tab2&lt;/p&gt; &lt;/div&gt; &lt;div id="Tab3"&gt; &lt;p&gt;Tab3&lt;/p&gt; &lt;/div&gt; &lt;div id="Tab4"&gt; &lt;p&gt;Tab4&lt;/p&gt; &lt;/div&gt; &lt;div id="Tab5"&gt; &lt;p&gt;Tab5&lt;/p&gt; &lt;/div&gt; &lt;div id="Tab6"&gt; &lt;p&gt;Tab6&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Each tab will submit a different form. I hope this helps to identify what I am trying to achieve. I am new to all this so please be specific.</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload