Javascript form submitting with multiple links -
I have simplified my code for this question but my last webpap has ~ 100 forms on one page instead of two. My question is, what is the best way to submit a form to my link with Javascript, which I do not clearly do, because there are several types of fields that are called support types. What is the best way I want to do ~ 100 forms on a large scale?
& Lt; A href = "javascript: getupport ('form1')" & gt; Form 1 & lt; / A & gt; & Lt; / Form & gt; & Lt; Form name = "albumdl" method = "post" action = "processLinks.php" & gt; & Lt; Input type = "hidden" name = "support type" /> & Lt; A href = "javascript: getupport ('form2')" & gt; To 2 & lt; / A & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;
You can dynamically create the form:
function getSupport (type) {var f = document.createElement ('form'), input = document.createElement ('input'); F.setAttribute ('action', 'processLinks.php'); F.setAttribute ('method', 'post'); Input.setAttribute ('name', 'supporttype'); Input.value = type; F.appendChild (input); F.submit (); }
Comments
Post a Comment