Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

At least one field completed to submit

Avatar

Avatar
Validate 1
Level 1
Eric_Rosenfeld
Level 1

Likes

0 likes

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Eric_Rosenfeld
Level 1

Likes

0 likes

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
Eric_Rosenfeld
Level 1

16-11-2015

Hi,

I have a form with 3 text fields with their values set as REQUIRED .  At least one of the fields must be completed in order for the email submit button to function.

Is there a script that will change the required fields to optional field values when at least one of the three contains data?

Thanks,

Eric

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile

Avatar
Establish
MVP
_Bruce_Robertson
MVP

Likes

271 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Establish
Give Back 25
Give Back 10
Give Back 5
Give Back 3
View profile
_Bruce_Robertson
MVP

18-11-2015

Hi Eric,

Just so you can keep the code in one place, you could wrap the three fields in a subform and have this JavaScript code in the subforms calculate event;

if (TextField2.isNull && TextField3.isNull) {

    TextField1.mandatory = "error";

} else {

    TextField1.mandatory = "disabled";

}

 

if (TextField1.isNull && TextField3.isNull) {

    TextField2.mandatory = "error";

} else {

    TextField2.mandatory = "disabled";

}

 

if (TextField1.isNull && TextField2.isNull) {

    TextField3.mandatory = "error";

} else {

    TextField3.mandatory = "disabled";

}

 

Regards

Bruce

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 1
Eric_Rosenfeld
Level 1

Likes

0 likes

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Eric_Rosenfeld
Level 1

Likes

0 likes

Total Posts

25 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
Eric_Rosenfeld
Level 1

18-11-2015

Hi Bruce,

Thanks for the solution!

Regards,

Eric