In my html, I have several forms (text inputs, radio buttons, check boxes and selections) and one button. I would like to fill out all of these forms and submit the values ββto a php file. At the moment, I'm trying to pass values ββfrom text input and select, but I'm stuck at this point.
I have a js send file:
submitForms = function(){ document.getElementById("form1").submit(); document.getElementById("form2").submit(); }
And my forms are as follows: SELECT:
<form id ="form1" name="dists" action="solve.php" method="post"> <select id="demo" name="sadzba" onchange="selectElement1(this.value)> <option value="">-- vyberte oblasΕ₯ --</option> </select> </form>
Text entry form + button:
<form id="form2" action="solve.php" method="post"> <input type="text" name="spotVT" ><label>kWh za rok VT</label> <div id="nt" style='display:none'><input type="text" name="spotNT" ><label>kWh za rok NT</label></div> </form> <input id="sub" type="button" value="Ok" style="margin-left:15px;" onclick="submitForms()"/>
But that does not work. could you help me? Thanks you
javascript jquery submit forms form-submit
user2886091
source share