Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.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
在单击jquery时附加输入标记,并将这些值发送到操作页面_Jquery_Html_Forms_Append_Action - Fatal编程技术网

在单击jquery时附加输入标记,并将这些值发送到操作页面

在单击jquery时附加输入标记,并将这些值发送到操作页面,jquery,html,forms,append,action,Jquery,Html,Forms,Append,Action,我试图在点击按钮时添加输入标签,但成功了。我提到了很多链接 但现在的问题是,我正在表单中使用这些输入标记,并试图使用表单操作将这些输入标记值发送到下一页。但是我无法发送附加的输入元素值 ** jquery $(“#addshowtime”)。单击(函数(){ $("") .attr(“id”、“showtime5”) .attr(“名称”、“显示时间5”) .prependTo(“showtime”); }); ** html <label><strong>Sh

我试图在点击按钮时添加输入标签,但成功了。我提到了很多链接

但现在的问题是,我正在表单中使用这些输入标记,并试图使用表单操作将这些输入标记值发送到下一页。但是我无法发送附加的输入元素值

**

jquery

$(“#addshowtime”)。单击(函数(){
$("")
.attr(“id”、“showtime5”)
.attr(“名称”、“显示时间5”)
.prependTo(“showtime”);
});
**

html

 <label><strong>Show Timing1</strong></label><input id="showtime1" type="time" name="show_timing1"  required/>
    <label><strong>Show Timing2</strong></label><input id="showtime2" type="time" name="show_timing2"  required/>
    <label><strong>Show Timing3</strong></label><input id="showtime3" type="time" name="show_timing3"  required/>
    <label><strong>Show Timing4</strong></label><input id="showtime4" type="time" name="show_timing4"  required/>

    &nbsp;&nbsp;&nbsp;<cfinput type="button" id="addshowtime" class="btn" onClick="addInput()" name="add" value="+" />
    &nbsp;&nbsp;&nbsp;<cfinput type="button" class="btn1" onClick="subInput()" name="sub" value="RESET" />
    <p id="showtime">
    </p>
显示计时1
显示计时2
显示计时3
显示计时4


我可以从您的代码中看出,您必须添加具有相同id的输入标记。如果您通过检测id的输入标记来捕获值,则会导致问题。

向我们显示您的代码并解释到底是什么问题发布您尝试过的代码。因此,每当我单击addshowtime按钮时,将显示一个新的输入类型=时间附加。提交时,添加的输入值必须发送到下一个页面,这样我就可以使用类而不是。谢谢,mate,它起到了作用。我试着用class来代替它,结果成功了。
 <label><strong>Show Timing1</strong></label><input id="showtime1" type="time" name="show_timing1"  required/>
    <label><strong>Show Timing2</strong></label><input id="showtime2" type="time" name="show_timing2"  required/>
    <label><strong>Show Timing3</strong></label><input id="showtime3" type="time" name="show_timing3"  required/>
    <label><strong>Show Timing4</strong></label><input id="showtime4" type="time" name="show_timing4"  required/>

    &nbsp;&nbsp;&nbsp;<cfinput type="button" id="addshowtime" class="btn" onClick="addInput()" name="add" value="+" />
    &nbsp;&nbsp;&nbsp;<cfinput type="button" class="btn1" onClick="subInput()" name="sub" value="RESET" />
    <p id="showtime">
    </p>