I have 2 select element in form. first select element is static and second select option change according to first select element. for this i used jquery ajax. i am getting all things. The problems comes when i submit the form. i dont get the second select element value. My code is working in IE. But not in Chrome and Mozilla. My html file is
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>DATA ENTRY</title>
<script type="text/javascript" src="js/jquery-min.js"></script>
</head>
<body>
<table class="data_table">
<form name="form2" id="form2" method="post" action="submit_ops.php" />
<tr>
<td>
<select name="databaseTable" class="databaseTable">
<option value="">Select Table</option>
<option value="value1">value1</option>
<option value="value2">value2</option>
<option value="value3">value3</option>
</select>
</td>
<td>
<select id="TableColumn">
</select>
</td>
</tr>
<tr>
<td colspan="3"><input type="submit" value="Continue" name="usubmit"/></td>
</tr>
</form>
</table>
</body>
<script type="text/javascript">
$(document).ready(function(){
$("[name^=databaseTable]").on("change", function(){
var val=$(this).val();
$.ajax({
type: "POST",
url: "ajax.php",
data: {"val" : val},
success: function(result){
$("#TableColumn" ).html(result);
}
});
});
});
</script>
</html>
When i submit the form the value of TableColumn(second select element) is unavailable.