How to get checkbox value?

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
WABez
User
Posts: 202

How to get checkbox value?

Post by WABez »

I'm using PHPMaker 2024.10. I have a checkbox on a form that I want to use the value to redirect a user to a different page if the checkbox is checked/unchecked.

My dumb question!
Server side:
Server Events > Global > Table Specific > Common > Row_Inserted I used the $this->terminate("mypage"); and it is working fine. Now for the checkbox value, to redirect the user to this page or not.
How can I evaluate whether the checkbox is checked or not?


arbei
User
Posts: 9401

Post by arbei »

It depends on how you add the checkbox. Is it one of the fields? In general, you can get it from $_POST["MyCheckboxName"].


WABez
User
Posts: 202

Post by WABez »

Thanks, yes it is one of the fields.

I have tried with:
if (isset($_POST["MyCheckboxName"]))
but no luck.


WABez
User
Posts: 202

Post by WABez »

Solved, error in the code.


mobhar
User
Posts: 11745

Post by mobhar »

If you are using Row_Inserted server event, then you may try: $rsnew["YourFieldName"] (change YourFieldName to your actual field name).


Post Reply