Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Totaly, Here is what i mean : I have one form as below:</p> <pre><code>&lt;div class="form"&gt; &lt;form method="post" action="index.php" id="app_1065" name="app_1065"&gt; &lt;input type="text" value="samefield" /&gt; &lt;input type="text" value="samefield" /&gt; &lt;input type="text" value="samefield" /&gt; &lt;input type="text" value="samefield" /&gt; &lt;!-- Key will be render when runtime and loading page --&gt; &lt;input type="hidden" name="key" value="dloadform" /&gt; &lt;input type="button" id="btn_dload" value="Download"&gt; &lt;input type="button" id="btn_try" value="Try Now"&gt; &lt;/form&gt; &lt;/div&gt; &lt;script&gt; $("#btn_dload").click(function(){ var formDownload = $(".form").find("form:first"); document.getElementById('mktForm_1065').submit(); return false; }); $("btn_try").click(function(){ var formTryNow = $(".form").find("form:first"); $(formTryNow).attr("id", "app_1160"); $(formTryNow).attr("name", "app_1160"); $(formTryNow).find("input[name='mkt_key']").val("tryform"); document.getElementById('app_1160').submit(); return false; }); &lt;/script&gt; </code></pre> <ul> <li>Explain: If user click the download form, it will submit with form id/name is app_1065, and key="download" by default. If user click the button try now, it will update the form with new id,name and key of try now form before submit form. </li> </ul> <p>Issue: - Now the download form works normally by default. But i don't why the try now form doesn't work after update the new id, name and key.</p>
 

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