snipt

Ctrl+h for KB shortcuts

HTML

Submit en etiqueta select

<select onchange="this.form.submit()" name="valor">
</select>
https://snipt.net/embed/2afee085020098a372f61d4fedc605f1/
https://snipt.net/raw/2afee085020098a372f61d4fedc605f1/
2afee085020098a372f61d4fedc605f1
html
HTML
2
2016-09-29T15:33:58
True
False
False
/api/public/snipt/46678/
submit-en-etiqueta-select
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nt">&lt;select</span> <span class="na">onchange=</span><span class="s">&quot;this.form.submit()&quot;</span> <span class="na">name=</span><span class="s">&quot;valor&quot;</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">&lt;/select&gt;</span> </span></pre></div> </td></tr></table>
html, select, submit

JavaScript

Submit form wth radio button

<input type='radio' name='score' value='4' onClick='this.form.submit()'/> 
https://snipt.net/embed/7b9c3d62dae5af266f2874e9a5f90c93/
https://snipt.net/raw/7b9c3d62dae5af266f2874e9a5f90c93/
7b9c3d62dae5af266f2874e9a5f90c93
js
JavaScript
1
2016-09-26T15:11:07
True
False
False
/api/public/snipt/33911/
submit-form-wth-radio-button
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="o">&lt;</span><span class="nx">input</span> <span class="nx">type</span><span class="o">=</span><span class="s1">&#39;radio&#39;</span> <span class="nx">name</span><span class="o">=</span><span class="s1">&#39;score&#39;</span> <span class="nx">value</span><span class="o">=</span><span class="s1">&#39;4&#39;</span> <span class="nx">onClick</span><span class="o">=</span><span class="s1">&#39;this.form.submit()&#39;</span><span class="o">/&gt;</span> </span></pre></div> </td></tr></table>
form, radio, submit

HTML

Submit form with javascript jquery

onclick="$('form[name=nameofform]').submit(); return false;"
https://snipt.net/embed/5ef1a2d960e6832e08b665874d7200c4/
https://snipt.net/raw/5ef1a2d960e6832e08b665874d7200c4/
5ef1a2d960e6832e08b665874d7200c4
html
HTML
1
2016-09-29T00:24:42
True
False
False
/api/public/snipt/22962/
submit-form-with-javascript-jquery
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a>onclick=&quot;$(&#39;form[name=nameofform]&#39;).submit(); return false;&quot; </span></pre></div> </td></tr></table>
form, javascript, jquery, submit

JavaScript

Disable button when form submit

1
2
3
4
5
<script type="text/javascript">
$('#myform').submit(function(){
    $('input[type=submit]', this).attr('disabled', 'disabled');
});
</script>
https://snipt.net/embed/060addbe6f98886c7ab7b32af0e4ef84/
https://snipt.net/raw/060addbe6f98886c7ab7b32af0e4ef84/
060addbe6f98886c7ab7b32af0e4ef84
js
JavaScript
5
2016-09-22T12:47:47
True
False
False
/api/public/snipt/15600/
disable-button-when-form-submit
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="o">&lt;</span><span class="nx">script</span> <span class="nx">type</span><span class="o">=</span><span class="s2">&quot;text/javascript&quot;</span><span class="o">&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#myform&#39;</span><span class="p">).</span><span class="nx">submit</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span> </span><span id="L-3"><a name="L-3"></a> <span class="nx">$</span><span class="p">(</span><span class="s1">&#39;input[type=submit]&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="s1">&#39;disabled&#39;</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="p">});</span> </span><span id="L-5"><a name="L-5"></a><span class="o">&lt;</span><span class="err">/script&gt;</span> </span></pre></div> </td></tr></table>
submit

JavaScript

Disallow doubleclick of form submit buttons

1
2
3
4
5
// Find ALL <form> tags on your page
$('form').submit(function(){
  // On submit disable its submit button
  $('input[type=submit]', this).attr('disabled', 'disabled');
});
https://snipt.net/embed/1496d75bda78a345f1d4dba2b3d89244/
https://snipt.net/raw/1496d75bda78a345f1d4dba2b3d89244/
1496d75bda78a345f1d4dba2b3d89244
js
JavaScript
5
2016-09-29T09:22:27
True
False
False
/api/public/snipt/12621/
disallow-doubleclick-of-form-submit-buttons
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="c1">// Find ALL &lt;form&gt; tags on your page</span> </span><span id="L-2"><a name="L-2"></a><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;form&#39;</span><span class="p">).</span><span class="nx">submit</span><span class="p">(</span><span class="kd">function</span><span class="p">(){</span> </span><span id="L-3"><a name="L-3"></a> <span class="c1">// On submit disable its submit button</span> </span><span id="L-4"><a name="L-4"></a> <span class="nx">$</span><span class="p">(</span><span class="s1">&#39;input[type=submit]&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s1">&#39;disabled&#39;</span><span class="p">,</span> <span class="s1">&#39;disabled&#39;</span><span class="p">);</span> </span><span id="L-5"><a name="L-5"></a><span class="p">});</span> </span></pre></div> </td></tr></table>
disable, form, javascript, submit
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.