Skip to main content
drslrb
Known Participant
November 29, 2023
Answered

Calculate value or enter value manually

  • November 29, 2023
  • 1 reply
  • 688 views

Hi.  How can I adjust this script to be able to write over it if need be?

event.value = this.getField("nopts").value * 4;
if(event.value == 0)
    event.value = "";
This topic has been closed for replies.
Correct answer Nesa Nurani

You can use this:

if(event.source && (event.source.name=="nopts")){
event.value = this.getField("nopts").value * 4;}
if(event.value == 0)
event.value = "";

As long as "nopts" value doesn't change you can enter value manually.

You can also change script a little and use it as validation script in "nopts" field.

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
November 29, 2023

You can use this:

if(event.source && (event.source.name=="nopts")){
event.value = this.getField("nopts").value * 4;}
if(event.value == 0)
event.value = "";

As long as "nopts" value doesn't change you can enter value manually.

You can also change script a little and use it as validation script in "nopts" field.

drslrb
drslrbAuthor
Known Participant
November 29, 2023

Perfect...thanks!