Ronak Vora
asked on
How to Change checkbox value after clicked and submit to form?
i have an jQuery with html
<input type="checkbox" name="<portlet:namespace/> push" id="pushnotifications" value="1" checked="checked" />
push notifications<br> <br>
In this input text i want to add jquery for changing value after clicked how can i got it?
<input type="checkbox" name="<portlet:namespace/>
push notifications<br> <br>
In this input text i want to add jquery for changing value after clicked how can i got it?
just replace "11111111111111111" by what you want :
jQuery(function($) {
$("#button").click(function() {
$("#pushnotifications").val(11111111111111111);
});
});
</script>
<body>
<form>
<input type="checkbox" name="<portlet:namespace/>push" id="pushnotifications" value="1" checked="checked" />
push notifications<br> <br>
<input type="submit" value="submit" id="button">
</form>
What is the reason for wanting to change the value?
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Open in new window