Is there a data type requirement for this to work properly?
I have tried the above code and my ROStage field is not populating.
Some background:
This is an "Edit" form
List column "Stage" is a dropdown SharePoint Choice field
"Stage" has a default value of "Initial Development"
Tried: "ROStage" as a Plumsail form Plain Text box
Tried: "ROStage" as a dropdown SharePoint Choice field
Tried: "ROStage" as a ReadOnly field
"Stage" is a dropdown SharePoint Choice field that gets hidden in a Staff Only Accordion
I want all users to be able to see the Stage the workflow is in presently. I thought that if a staff member updated the Stage in the hidden accordion, it would be nice for the ReadOnly field to update as well, to display progress of the workflow.
Some code snippets, other than your suggestion, I have found and have been trying to adapt are:
fd.spRendered(function() {
//Set field value with the value from the parent on form load
fd.field('ROStage').value = fd.field('Stage').value;
function onchange() {
//Since you have JQuery, why aren't you using it?
var box1 = $('#Stage');
var box2 = $('ROStage');
box2.val(box1.val());
}
$('Stage').on('change', onchange);
});
function change(){
var src= document.getElementById("sourceTextField");
var dest= document.getElementById("destinationTextField");
dest.value=src.value;
}
Depend on the field type there are different methods of getting and setting the values. Please find more information in the documentation here and in the Manipulate fields dynamically article.
In case you need to populate the text field with the value from the drop-down filed when the value is chaged, you can use this code: