Skip to main content
drslrb
Known Participant
Nov 29, 2023 3:25 PM UTC
Answered

Calculate value or enter value manually

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 is closed to new replies. Start a new post to keep the conversation going.
Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
Nov 29, 2023 4:18 PM UTC

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.

2 replies

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
Nov 29, 2023 4:18 PM UTC

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.

Translate
drslrb
drslrbAuthor
Known Participant
Nov 29, 2023 4:45 PM UTC

Perfect...thanks!

Translate