Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Javascript help

Community Beginner ,
May 04, 2021 May 04, 2021

Field name:  group1, group2

group1 = 200 if group2 is more than zero if not leave blank

How do i write this script please?

TOPICS
JavaScript
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
May 04, 2021 May 04, 2021

As validation script of "group2" field use this code:

this.getField("group1").value = event.value > 0 ? 200 : "";

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 04, 2021 May 04, 2021

As validation script of "group2" field use this code:

this.getField("group1").value = event.value > 0 ? 200 : "";
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 05, 2021 May 05, 2021
LATEST

A general tip: For calculations it's better to use the Calculate event of the target field, unless there's a good reason not to do so.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines