Sunday 5 January 2020

enable or disable button using check box using javascript

<!DOCTYPE html>
<html>
<body>
<div id="agree-form" >
    <form method="post" action="$action_url">
    <div id="button-part" style="float:left;margin-right:50px;">
    <input type=checkbox name="agree" id='agree_terms' value='agreed'" onclick="document.getElementById('agreesubmit').disabled =  this.checked ? false:true;"/>
    <label>Agree</label>
    </div>
    <div class="elgg-foot">
    <input style="width:100px" type="submit" id="agreesubmit" value="Submit" disabled>
    </div>
     </form>
</div>
</body>
</html>

No comments:

Post a Comment