Step b y step on how to get a radio button to enable a textbox

Hi
Does anyone have any step by step instructions on how to get a radio button to enable/disable a text box?

Thanks
Steve

Disabling is typically done with Rules. So we need to know:
1 - DataView.Column to disable
ABCCode.PcntTolerance
2 - DataView.Column.Value to bind radio and condition the rule.
TransView.EnableTolerance

Our rule will look like this:

Since we’re using a custom column on TransView, let’s initialize it.
Trigger > Event > After > SysIntitTransView
row-update > TransView.EnableTolerance > Expression: 'true'

note the single quotes in both the rule condition and row-update - radio button seems to only do strings. make sure we’re not comparing numbers booleans, etc.

Now we need our radio buttons
epBinding: TransView.EnableTolerance

and now the radio options
Advanced > Data > add True:true and False:false


note: no single quotes in radio options, again string is assumed here. I had trouble with 1/0, true/false until I noticed that.

3 Likes

Thanks Josh (@jbooker )
I understand how to bind the Textbox & Radio Button to the TransView DataView
But the TextBox also needs to be bound to a Database field.
This is what I currently have setup in TransView

These are the textboxes I need to enable/disable

I presume that when I build the rule for each Radio Button it will have two actions
One to enable one Textbox and one to disable the other.

Thanks for you help it is really appreciated

Steve

Hi Steve

Unfortunately there’s no enable action in rules only disable. So you’ll need a separate rule for each textbox.

Notice ABCCode.PctTolerance (#1) in my example is the epBinding dataview field (database field) of my textbox. Rules apply to all components bound to the dataview fields in actions. You’d substitute your own in each rule respectively.

Question, is your intent to make it either-percent-or-value? Meaning when one is enabled the other disabled? If so, you still need two rules but can use the same epBinding field for your radio conditions, one for true and one for false. Also if so, you’d want one radio component having two options rather than two radios That way the value toggles between percent/value

So think of rules applying to the data table of your textbox not necessarily the dataview of the condition fields driving the rule. TransView in my example was just a place to bind the radio value since I had no other field. You could bind it to any field including one that persists in the database if available.

1 Like