You need to sign in to do that
Don't have an account?
Magnetism
Inputcheckbox value returns a value 'on' upon selection
I have three fields I am currently trying to get results on and after that I am going to implement the same methods to work on the rest of the fields. So, I have two picklist fields of single selects and a inputcheckbox. I am calling the RemoteAction method in controller from javascript to get the user selected values back to the controller. From there I will get use those values to do some dml operations. So, for the two picklist fields, I am able to get the values back to controller in the form of the Id's. But for the inputcheckbox the value is returning to be false even though it is selected. And another thing I noticed was, when I alert({!inputcheckbox}); value in the page, the same field value returns "on". I am looking for some help. I greatly appreciate it.
Inputcheckbox returns a boolean value true or false and when you pass a property in inputcheckbox value attribute then you get the value of checkbox in controller. Forex.
your page contains:
and controller is:
when you see your debug log on first go then value is null and when select the checkbox and click on back button then value of chckboxvalue variable in controller changes to TRUE
let us know if you have any question .
please don't Forget to Mark this as your best answer if it works fine for you
Regards,
Grazitti Team
Web: www.grazitti.com.
In document.getElementById('Id').Value; I had to replace '.value 'with '.checked' . It worked fine. But I consider using jquery to do the same. I will explore that too. Thanks for your input. Thank you all.