I have a URL parameter that I want to replace based on whether a checkbox has been checked:
<input id="acknowledge" type="checkbox" checked="checked" name="acknowledge" tabindex="">I accept
<a href="p_add_institution?id=55&p_acknowledge=Y" class="stronglink" id="add-institution">Add another institution</a>
I want to replace p_acknowledge parameter to be p_acknowledge=N if the checkbox is not checked and p_acknowledge=Y if it is checked.
It always return p_add_institution?id=55&p_acknowledge=Y even if the checkbox is not checked.
Also, when I hover over the link, I want to have the proper URL showing up as well.
http://jsfiddle.net/u89usjnj/5
Any help would be appreciated and if anyone can explain why it the parameter is not switching to N
Thanks