Quite complex, but intrinsically simple.
I have a frm, with a tickbox and a link which says Terms and Conditions.
The scenario, user clicks the link, which opens a modal window. This has terms and conditions in it, and cannot be closed, unless user agrees to our terms, by clicking submit button ( acceptance )
What I wish to do is, disable the checkbox, on the original form, UNTIL they have opened the modal window and accepted the terms, upon clicking acceptance, the modal window closes, and the tickbox becomes visible and is ticked.
Any ideas, how to achieve开发者_开发知识库 this, please.
............. Modal window, is all done working fine and dandy. Its submit button code is
<button class="btn btn-blue" onclick="$.lightbox().close();">I Accept these Terms and Conditions</button>
The tickbox element code is:
<div class="checkbox">
<span class="label"> </span>
<div><input name="tac" id="tac" class="checkbox" value="yes" type="checkbox"> <label style="display: inline;" for="tac">I agree to the <a href="terms.html?lightbox[width]=600&lightbox[height]=600&lightbox[modal]=true" class="lightbox">Terms and Conditions</a></label></div>
</div>
<button class="btn btn-blue" id="btnAcceptTerms">I Accept these Terms and Conditions</button>
<div class="checkbox">
<span class="label"> </span>
<div><input name="tac" id="tac" class="checkbox" value="yes" type="checkbox" disabled="disabled" > <label style="display: inline;" for="tac">I agree to the <a href="terms.html?lightbox[width]=600&lightbox[height]=600&lightbox[modal]=true" class="lightbox">Terms and Conditions</a></label></div>
</div>
$(document).ready(function(){
$("#btnAcceptTerms").click(function(){
$.lightbox().close();
$("#tac").attr("disabled","");
});
});
This code disable the input until you click the btnAcceptTerms.
精彩评论