We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

checkbox returns boolean instead of given value

Hi,

I have several checkboxes in my reactive form. Each checkbox has a value argument. When I check the box, not the given value (here "testwert") goes to my form, but the boolean TRUE. When I uncheck the box, the value in my form is the boolean FALSE. Initially the form value is an empty string.
<ejs-checkbox formControlName="test" value="testwert" label="test"></ejs-checkbox>
Am I doing anything wrong here?

Thank you.

Michael


3 Replies

SA Sridhar Alagiri Samy Syncfusion Team November 20, 2019 02:00 PM UTC

Hi Michael, 
  
Good day to you.
  
We have checked the reported issue in our checkbox. By default, the angular reactive form will return the Boolean type for checkboxes during form submit.
  
We have created a sample using angular reactive form for getting the selected checkbox values on form submit. Please refer the below sample link.
  
  
If we misunderstood your requirement, please share more details about this. So that we can work on this and provide you a better solution quickly. 
  
Regards, 
Sridhar A. 



MH Michael Hertlein November 23, 2019 02:42 PM UTC

Thank you.
If this is the only way to get the "real" value, it would help if this would be documented.

Michael


AD Arunkumar Devendiran Syncfusion Team November 25, 2019 10:03 AM UTC

Hi Michael, 
 
Thank you for your update. 
 
We have checked your reported suggestion regarding online documentation, we will consider this in our end and upgrade the online documentation site in any of our upcoming release. We will update you once refreshed in live. 
 
Regards, 
Arunkumar D 


Loader.
Live Chat Icon For mobile
Up arrow icon