Copy field value (based on checkbox value), transfer to another field....but with a twist!
Hi all,
Am curious to know if the follwoing is possible/plausible?.
I have a checkbox ("Crsdeferred1a") that when selected, transfers the user entered text value from another field ("Correctives1") to the field ("Correctives1copy"). The script in the "Correctives1copy" field to do this is thus;
if (getField("Crsdeferred1a").value=="DEF")
this.getField("Correctives1copy").value = this.getField("Correctives1").value;
De-selection of the checkbox ("Crsdeferred1a") leaves the text entered in the field, and is desired to be that way. Of course, if the user changes the text entered in the ("Correctives1") field, then re-selects the checkbox, it updates to the new text, which again is fine.
The 'twist' comes with this - is it possible to have a range of fields named "Correctives1copy", "Correctives2copy", "Correctives3copy" - that if the checkbox is re-selected, rather than update any value text-wise that is changed in field "Correctives1" - it then looks to see if any of these 3 fields are empty, and then transfers then entered text ("Correctives1") into an empty (i.e. available) field from the 3? ("Correctives1copy", "Correctives2copy", "Correctives3copy").
So, if i enter the text "deferred iaw 34-09-54A", select the checkbox, this transfers the text (with current script) to the "Correctives1copy" field. All good. If I now de-select the checkbox, re-enter the text, say "No longer an issue.", and then re-select the checkbox - rather than update the value in the field "Correctives1copy" - some script may be looks for the next empty field from the 3 "copy" fields, and enters the new text in to say "Correctives2copy", assuming that field is empty? or if filled previously, then to "Correctives3copy". These copy fields are set to "Read Only", no adjustment possible.
A bit unusual I'm sure, any advice greatly received.
