Server error 500 Checkbox as Single switch December 14, 2018, 01:45:32 AM I have a MySql database with Tinyint(1) for checkbox fields.When i put in the field properties of the checkbox as "Single Switch", it gives me an error internal 500. ( Error Processing Request)So i can't add or edit any record. Please advise.Thanks Quote Selected
Re: Server error 500 Checkbox as Single switch Reply #1 – December 15, 2018, 04:53:13 PM Hi Grou,Thanks for the update. can you provide us with more detail of this error. I would suggest if you can change the Tinyint to any other format to see if it works.Also if you can share screenshot of your browser console.Thanks for your support. Quote Selected
Re: Server error 500 Checkbox as Single switch Reply #2 – December 16, 2018, 03:05:28 AM Hi Emman...After several tests in a separate table, the checkbox as "Single Switch" only works when the datatype field is varchar with a minimum size as 4. So it stores the word "true" when the checkbox is checked and "" when checkbox is false. (no matter if you change the values of checkedvalue or uncheckedvalue)It don't make sense, but it was the only way i found to workaround this problem.If you know another way, please tell me... i want to use the "single switch" because of its professional look and graphical appearance as tinyint (1). 0 for false and 1 for true.Regards. Quote Selected Last Edit: December 16, 2018, 03:16:06 AM by grou
Re: Server error 500 Checkbox as Single switch Reply #3 – June 03, 2020, 03:38:28 PM The problem still exists (PHPRad 2.7.3, PHP 7.4.6, MariaDB 10.4). Quote Selected
Re: Server error 500 Checkbox as Single switch Reply #4 – June 04, 2020, 07:41:19 AM @machobymb please note that the database stores true/false as 1/0 respectively when using a type of tinyint(1) and the value for phprad CheckedValue and UnCheckedValue is a string. The ways you can circumvent the issue is by intercepting the value before inserting and converting it to boolean or int (1 or 0) value. Quote Selected