我已将outerHTML内容存储在数据库中。当我匹配某些属性时,我正在加载该html页面。加载的内容包含提交函数定义。当我第二次加载时它不会进入提交功能。
提交功能代码:
$('document').ready(function() {
$('#formData_2').submit(function() {
alert("inside form2");
}
}
this is outerHTML content stored in DB:
<div id= "division">
<form name="branch_input" method="POST" action="check_db_status.cgi" id="formData_1" >
Branch <select name="branch">
option value="dir1">dir1o</option>
</select>
CL <input type="text" name="Change_num" required/>
<input type="submit" value="Submit">
<br> <br>
</form>
<br><br>
<div id="hidden_1" style="display: none;">
<br><br><br>
<form id="formData_2" name="input_1" method="POST" action="update_file1_info.cgi" >
<h2 align="center"> Select Required Files </h1>
File1 <input id="input1" type="text" name="in_1" DISABLED />
<input id="check_1" type="checkbox" onClick="toggle('check_1', 'input1')"> <br>
File2 <input id="input2" type="text" name="in_2" DISABLED />
<input id="check_2" type="checkbox" onClick="toggle('check_2', 'input2')" > <br>
File3 <input id="input3" type="text" name="in_3" DISABLED />
<input id="check_3" type="checkbox" onClick="toggle('check_3', 'input3')">
<input id = "sub_id1" type="submit" value="submit">
</form>
<br> <br><br>
</div>
<div id="hidden_2" style="display: none;">
<form id="formData_3" name="input_2" method="POST" action="update_file2_info.cgi">
<h2 align="center"> Select Required Files</h2>
File1 <input id="input4" type="text" name="in_4" DISABLED />
<input id="check_4" type="checkbox" onClick="toggle('check_4', 'input4')"> <br>
File2 <input id="input5" type="text" name="in_5" DISABLED /> <input id="check_5" type="checkbox" onClick="toggle('check_5', 'input5')" >
<input id = "sub_id2" type="submit" value="Submit">
<br><br>
</form>
<br><br>
</div>
<div id="hidden_3" style="display: none">
<form id="formData_4" name="input_3" method="POST" action="send_final_mail.cgi">
<h2 align="left"> Build is Ready </h2>
<input type="submit" value="Submit">
</form>
</div>
</div>
单击提交按钮时,表单数据提交功能没有响应。