Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
...
This is the Javascript code that reads the value of the subform and sets the field value.
Code Block | ||
---|---|---|
| ||
<script>
$(document).ready(function(){
selectmain = $(FormUtil.getField("field1")); //Get ID of subform
selectmain.on("change",function(){
setTimeout(function(){
my_name = $("#field2_subform_name"); //Get subform value
my_country = $("#field2_subform_country");
my_date = $("#field2_subform_date");
var field1 = FormUtil.getField("field3"); //Get field of form
var field2 = FormUtil.getField("field4");
$(field1).val(my_name.val()); //Set field to value of subform
$(field2).val(my_country.val());
},100);
});
})
</script>
|
Download the sample app: