I have a similar problem to this but I have some relational Javascript that fills out just fine in the form but then on Submit it doesn't get saved. Other parts of the Javascript work, just this one doesn't. I have a lot of calculations that are using Javascript so I will only post the part that doesn't work, let me know if you need the whole thing:
Some Data pulls from our SQL database, then I manipulate it, like the type, but I want to set a field to something that makes more sense "translate it":
//Determine if Online or On-Ground course
$(".type input").change(function(){
var type = $(".type input").val();
if (type == "ONLN"){
$(".subtype input").val("Online");
}
else if (type == "LEC"){
$(".subtype input").val("On-ground");
}
});
So here is another piece of code that populates when filling out, but disappears when Submitted:
//Assign Assignor & Address
$(".type").change(function(){
var type = $(".type input").val();
if (type == "ONLN"){
$(".assignor input").val("Jane Doe");
$(".titleassi input").val("Dean of Online Education");
}
else if (type == "LEC"){
$(".assignor input").val("John Smith");
$(".titleassi input").val("Dean of AGS Operations");
}
});
Please help!