Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在临时表中存储文本框值_Javascript_Mysql_Jsp - Fatal编程技术网

Javascript 在临时表中存储文本框值

Javascript 在临时表中存储文本框值,javascript,mysql,jsp,Javascript,Mysql,Jsp,我有一个表单,其中包含十个文本框,用于输入一些数据。该表单有一个提交按钮和一个下一步按钮。当我单击next按钮时,它必须再次打开十个文本框,并且必须将以前的信息存储到MySQL数据库中的临时表中或以任何其他方式。最后,如果我单击submit按钮,它必须将完整的信息存储到另一个永久的MySQL数据库表中 我该怎么做 这就是我迄今为止所尝试的: <form name="form2" action="addingstuden_data.jsp" method="POST"> <

我有一个表单,其中包含十个文本框,用于输入一些数据。该表单有一个提交按钮和一个下一步按钮。当我单击next按钮时,它必须再次打开十个文本框,并且必须将以前的信息存储到MySQL数据库中的临时表中或以任何其他方式。最后,如果我单击submit按钮,它必须将完整的信息存储到另一个永久的MySQL数据库表中

我该怎么做

这就是我迄今为止所尝试的:

<form name="form2" action="addingstuden_data.jsp" method="POST">
    <table align="center">
        <th colspan="3" class="style30"><font size="5">Adding Students for<%=stream%>-<%=year3%></th>
    </table>

    <table align="center" border="1">
        <tr>
            <td class="heading" align="center" >SNo</td>
            <td class="heading" align="center" >Student Id</td>
            <td class="heading" align="center">Student Name</td>
        </tr>
        <% 
            int i;
            for(i=0;i<62;i++)
            {
        %>
        <tr>
            <td><input type="text" name="SNo" value="<%=i%>" id="r2" size="1"> </td>
            <td><input type="text" name="stdid"  id="sid" size="4" value=""> </td> 
            <td><input type="text" name="stdname"  id="sname" value=""> </td>
        </tr> 
        <% } %>
    </table>
    <table width="100%" class="pos_fixed">
        <tr>
            <td align="center" class="border"><input type="submit" name="submit" value="submit"> </td>
        </tr>
    </table>
</form>

增加学生人数-
斯诺
学生证
学名

试试这个,根据您的需要设计样式

<form name="myform" method="POST" action="youraction">
<div id="forms">
 <input type="text" name="feilds[]">
 <input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
<input type="text" name="feilds[]">
</div>
<input type="button" name="next" value="next" onclick="next()">
<input type="submit" name="submit" value="Submit">
</form>

Javascript代码

function next()
{
 var ele = document.getElementById('forms');

 for(var i=0;i<10;i++)
 {
    var name = document.createElement("input");
    name.setAttribute('type',"text");
    name.setAttribute('name',"feilds[]");
    ele.appendChild(name);
 }    

}
函数next()
{
var ele=document.getElementById('forms');
对于(var i=0;i