ncbruckner
Returning Observer

RULE to select value of checkbox depending on another field

Jump to solution

Hi,

I have following use case: If a text field is not empty, I need to select a value in the input checkbox. The value of the text field is not the value that needs to be selected in the checkbox.

Is there some way to do this with normal rules? Or do I need a value service for this?

Best regards,

Nina

0 Kudos
1 Solution

Accepted Solutions
hoebbel
Crownpeak employee

Hello Nina,

Should the combobox value be fixed, if the textfield is not empty? And when it is manually emptied, should the editor manually change the value of the combobox?

If so, this might be a solution:

 

	<RULE>
		<IF>
			<NOT>
				<PROPERTY name="EMPTY" source="myTextField"/>
			</NOT>
		</IF>
		<WITH>
			<TEXT>desired value of the combobox</TEXT>
		</WITH>
		<DO>
			<PROPERTY name="VALUE" source="myCombobox"/>
		</DO>
	</RULE>

 

Attention: This rule is ignored if the text field is empty. As soon as it is filled, the rule is executed and changes the value of the combobox (and the editor cannot change the value afterwards). If it is emptied again, the rule is ignored and the value remains!

Best regards
Holger

View solution in original post

0 Kudos
2 Replies
hoebbel
Crownpeak employee

Hello Nina,

Should the combobox value be fixed, if the textfield is not empty? And when it is manually emptied, should the editor manually change the value of the combobox?

If so, this might be a solution:

 

	<RULE>
		<IF>
			<NOT>
				<PROPERTY name="EMPTY" source="myTextField"/>
			</NOT>
		</IF>
		<WITH>
			<TEXT>desired value of the combobox</TEXT>
		</WITH>
		<DO>
			<PROPERTY name="VALUE" source="myCombobox"/>
		</DO>
	</RULE>

 

Attention: This rule is ignored if the text field is empty. As soon as it is filled, the rule is executed and changes the value of the combobox (and the editor cannot change the value afterwards). If it is emptied again, the rule is ignored and the value remains!

Best regards
Holger

0 Kudos
ncbruckner
Returning Observer

Yes, that works for me.

I needed to change it to  <PROPERTY name="SELECT" source="myCheckbox"/> but that works. Thank you.

0 Kudos