Skip to main content
Participant
October 9, 2020
Question

Manual Entry Not Visible in Overwritten Field

  • October 9, 2020
  • 1 reply
  • 209 views

So, I've used a script posted by Max Wyss that allows me to overwrite a field that contains a calculation (using a control checkbox that removes read-only when it is checked). The script works, however after I check the control box, what ever value I type into the field goes invisible once I hit return. The value is there because it shows up in the grand total at the bottom of the page. Is there a trick to making the overwriting entry visible? I'm pasting Max's original post here:  

 

Let's assume that the field to be made overwriteable is called "myResult", and the controlling checkbox is called "myResultCtrl".

 

The checkbox will get the following script in the mouseUp event:

 

if (event.target.value == "Off") {

this.getField("myResult").readonly = true ;

} else {

this.getField("myResult").readonly = false ;

}

 

 

In the calculation involving the myResult field, you will add the following structure (you may have to adjust it for the calculation)

 

if (this.getField("myResultCtrl").value == "Off") {

// regular calculation code for field myResult comes here

} 

And that should get you closer to the intended result.

Hope this can help.

By Max Wyss   

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
October 9, 2020

You don't need script in checkbox, use this as Custom Calculation Script of "myResult" field:

 

event.value = here goes your calculation;
event.rc = this.getField("myResultCtrl").value == "Off";
event.target.readonly = event.rc;