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

Textboxes linked to radio buttons are still required even after form is cleared

New Here ,
May 14, 2024 May 14, 2024

Copy link to clipboard

Copied

I am trying to create a document that if a radio button is selected it makes three following text boxes next to it required (there are three radio buttons with their own three text boxes linked to them).

 

I was able to get the formula to work where if a radio buttonis required, the textboxes linked to it are required. The problem I am having is one of the radio buttons is always selected. If I use "Clear Form" the button may not be selected by the textboxes linked to the button that was previsouly selected is still showing as being required to fill out as if the radio button was still selected.

 

The problem with this is when we send the form out, even if a client selects a new radio button the text boxes that are required are the ones linked to the radio button that was previously selected when the form was sent to fill out.

 

 

The formula I used for each radio button is:

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

this.getField("Card Number 1").required = true;

this.getField("Security Code 1").required= true;

this.getField("Expiration Date 1").required= true;

this.getField("Card Number 2").required = false;

this.getField("Security Code 2").required= false;

this.getField("Expiration Date 2").required= false;

this.getField("Card Number 3").required = false;

this.getField("Security Code 3").required= false;

this.getField("Expiration Date 3").required= false;

}

TOPICS
JavaScript

Views

48

Translate

Translate

Report

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 14, 2024 May 14, 2024

Copy link to clipboard

Copied

When you reset the form you must set also required to false.

Votes

Translate

Translate

Report

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 15, 2024 May 15, 2024

Copy link to clipboard

Copied

LATEST

That's the problem when using a Mouse Up event for such things, as it doesn't get triggered when the file is cleared.

I would recommend moving the code to be the custom calculation script of a (hidden) text field, instead.

Votes

Translate

Translate

Report

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