Updating text input value when radio button is unchecked

I have a form where a radio control when checked displays a box with a default no of 1. that works great with a dynamic event of show when radio control is checked.

What I need to do is reset the textbox value to 0 when the radio control is unchecked. I can’t seem to find a way to do this. Is there any kind of local conditional if/then logic within wappler, not in server actions where I know its possible?

thanks,
Rick

Not sure if this answers your question, but here goes.

Have a default value in the database table of ‘0’. This has the effect that, if the checkbox is checked, it will post the value of the checkbox; if the checkbox is unchecked, the value will revert to ‘0’.

1 Like

thanks, I got it.

What to do when you need to update the value from 1 back to 0?
Unchecking a box doesn’t send a value, for now i put {{$_GET.c_status.default(0)}} on the Update action. So it fills a 0 when no value is sent , works great

Maybe have a feature to allow us o choose check/unchecked values…

Hello @Kattouf
the default formatter IS the way to go. That’s the right approach for checkboxes, as they don’t send any value if unchecked.

1 Like