I'm working on a mysql/php form. I am repopulating the form on page load. My question is how do I force the change function in the ajax function, which is used in a dependent select box.
The Ajax script is:
<script type="text/javascript">// Dynamic Support Select based on Depth
$(document).ready(function(){
$("#Depth").change(function(){
var depth=$("#Depth").val();
$.ajax({
type:"post",
url:"support_get.php",
data:"depth="+depth,
success:function(data){
$("#A_Sup").html(data);
$("#B_Sup").html(data);
}
});
});
});
</script>
The function to repopulate the page steps through the form setting values based on saved values in the mysql table. I was setting the value of 'Depth' and then trying to trigger as follows, but it doesn't fire. ???
Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.
$("Depth").trigger("change
-- change to --
$("#Depth").trigger("chang