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

Fill text field with checkbox choice

gretchenhs42
Level 3
Level 3

I don't think I can do this, but is there a way to fill a text box with a checkbox choice?  So I have 10 checkboxes that are connected only in the sense that in the click field I have the other checkboxes.rawValue=0;

The business wants me to pre-fill the text field with the value that is selected in these checkboxes.CPAPPES.jpg

Ideas?

We made them checkboxes, because the business also wanted to be able to uncheck the box if they decide they don't want the coverage.

9 Replies
Magus069
Level 10
Level 10

you have two ways of doing this.. depending on how your checkbox was created

you can use

TextField14.rawValue = CheckBox14.caption.value.text.value;

OR

TextField14.rawValue = CheckBox14.caption.value.exData.value;

jenn_bradford77
Level 1
Level 1

set the on values of each checkbox to reflect those captions, then

put one of these in each checkbox under click

if (LimitOption1.rawValue != 0 )

{

    CoverageLimit.addItem(LimitOption1.rawValue);

}

else if (LimitOption1.rawValue == 0)

{

    CoverageLimit.deleteItem(LimitOption1.rawValue);

}

gretchenhs42
Level 3
Level 3

DO I have to group the checkboxes in some way?  So it will choose which one has the correct answer?

jenn_bradford77
Level 1
Level 1

add some of these in the if statement

LimitOption2.rawValue = "0"

LimitOption3.rawValue = "0"

or make them radio buttons and group them

Magus069
Level 10
Level 10

if you can only choose one checkbox, why don't you make it a radiobutton list with checkbox interface instead of doing changing the value of all checkboxes to 0

jenn_bradford77
Level 1
Level 1

the radio button doesn't leave you the option of choosing nothing after you've clicked on one though.

" because the business also wanted to be able to uncheck the box if they decide they don't want the coverage"

Magus069
Level 10
Level 10

you can uncheck a radio button if you do it.... if you leave a radiobutton list like so it wont uncheck by itself

jenn_bradford77
Level 1
Level 1

can you elaborate please on how you can leave the option to chose nothing after a user originally clicks on radio button then changes their mind?

Magus069
Level 10
Level 10

doesnt matter how many radiobuttons you have... you need 3 methods in a script object

As simple as this... you could be able to do it in only the click event but it's always easier using scriptObjects.