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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

If Radio button == "1" Then object property user entered = required

Avatar

Level 3

I would like to know if there is a way to change the user entered-required property of an object dynamically.  i want to say something like:

if(radioButton1 == "1")

{

objectPropertyRequired = "Required";

}//end if

Any help is greatly appreciated.

Justin

1 Accepted Solution

Avatar

Correct answer by
Level 10

Your code is almost correct; Just add .rawValue  after radioButton1

Your code should look like:

if(radioButton1.rawValue == "1")

{

objectRef.mandatory = "error";

}//end if

Nith

View solution in original post

0 Replies

Avatar

Level 10

Justin,

The attached uses a radio button group to toggle a field from/to required.

Steve

Avatar

Correct answer by
Level 10

Your code is almost correct; Just add .rawValue  after radioButton1

Your code should look like:

if(radioButton1.rawValue == "1")

{

objectRef.mandatory = "error";

}//end if

Nith

Avatar

Level 3

Thank you everyone for your input I really appreciate it!!!!!  Here is what I ended up using:

<event activity="click" name="event__click">

<script contentType="application/x-javascript">

if (RadioLocation.rawValue == "1") {

if (DropDownList2.isNull) {

DropDownList2.mandatory = "error";

}

}

if (RadioLocation.rawValue == "1") {

if (TextField23.isNull) {

TextField23.mandatory = "error";

}

}

</script>

</event>

Again Thank you for everyone who submitted feedback and examples I really really appreciate it!!!

Justin