I am new to Angular JS. I have created a form which is having a terms & agreement checkbox at the bottom. My requirement is when the user clicks the submit button without checking the checkbox, a div containing the error message should be displayed.
Currently the checkbox if not selected just appears RED as its a required field. How can i bind the submit functionality on ng-click with the checkbox check and ng-show a div.
My HTML looks like this -
<p class="note">
<input type="checkbox" ng-model="user.termsagreement" name="termsagreement" value="true" required id="TermsAndConditions">
<span class="checkBoxText">
<span class="mandatory">*</span>I agree to the Terms & conditions</span>
</p>
<div class="ui-state-error h5-message" ng-show="_ServerForm.termsagreement.$error.required">Please select the Checkbox before submit</div>
<div style="float:right" class="buttonSimple">
<a name="Register" id="RegisterUser" href="#" class="" ng:click="submitform(true)"><span>Registrieren</span></a>
</div>