Produce error if user tries to toggle without correct inut

I’m using Ionic toggle and want to create a rule set that states: user only allowed to toggle if Input A is not empty. Then if the user tries to toggle with no data in Input A, it highlights that Input A is missing.

I’ve currently got it set up with a conditional ‘input is disabled’ if input A is empty. Clearly this isn’t optimal since it doesn’t produce an error for the user.

Is there a way to highlight to the user Input A is required if they use the toggle with A empty?

Hi there, @andrewmccalister… if I understand your post correctly, a condition like this one could do the trick, but it lets the user actually toggle the icon, and I’m guessing that’s not what you want, right?

If you want the user to get a cue without being able to toggle the icon, you could keep the icon disabled when input A is empty, and you could maybe do something when the icon is hovered like this.

You could also use a condition similar to the one above to show a text element that displays a message when the icon is hovered and the input is empty.

Anyway, just some options there, and I hope this helps.


1 Like

Great solution - implemented!

1 Like