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

How can I verify promo code and enable or checked checkbox when the promo code is correct or valid

Hello!
How can I verify promo code from the database and enable or checked checkbox when the promo code is correct or valid 

1 Reply 1 reply marked as answer

SD Saranya Dhayalan Syncfusion Team June 10, 2020 05:56 PM UTC

Hi Ishan, 
 
Thank you for contacting Syncfusion support 
 
We have checked your reported query, we suspect you want to dynamically change the checkbox state. You can achieve this by changing the checkbox checked property in button click event. Please find the below code snippet: 
 
<button class="e-btn" id="btn">Save Json</button> 
 
@Html.EJS().CheckBox("checked").Change("onChange").Checked(true).Label("CheckBox").Render() 
 
<script> 
document.getElementById(btn).onclick = function () { 
        var chkboxObj = ej.base.getComponent(document.getElementById("checked"), "checkbox"); 
        if (chkboxObj.checked) { 
            chkboxObj.checked = false; 
        } 
        else { 
            chkboxObj.checked = true; 
 
        } 
    } 
</script> 
 
 
Could you please check the above code snippet and let us know whether this is fulfilling your requirement? 
 
Regards, 
Saranya D 


Marked as answer
Loader.
Live Chat Icon For mobile
Up arrow icon