Monday 13 January 2020

toggle a dom element by id using radio button group jquery

    $('input:radio[name="radiogroupname"]').click(function() {
        if ($(this).val() == 'one') {
            $('#id').show();//css('display','block');
        }
        else {
            $('#id').hide();//css('display','none');
        }
    });

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>