Skip to content

Instantly share code, notes, and snippets.

@apih
Created August 23, 2017 05:50
Show Gist options
  • Save apih/bd0816c4e608ac714d4b2517823b070e to your computer and use it in GitHub Desktop.
Save apih/bd0816c4e608ac714d4b2517823b070e to your computer and use it in GitHub Desktop.
Code for adding client email confirmation in OnPay form
<script type="text/html" id="client_email_confirmation_template">
<div class="form-group ">
<label for="client_email_confirmation" class="control-label col-md-3">Sahkan Emel<span class="glyphicon glyphicon-asterisk red-asterisk"></span></label>
<div class="col-md-7">
<input type="email" class="form-control" id="client_email_confirmation" name="client_email_confirmation" placeholder="Sahkan emel anda..." maxlength="100" value="">
</div>
</div>
</script>
<script type="text/javascript">
FDRE.register(function() {
var template = getTemplate("#client_email_confirmation_template");
$("#client_email").closest(".form-group").after(template);
$("#client_email_confirmation").rules("add", {
required: true,
email: true,
equalTo: "#client_email",
messages: {
required: "Sila masukkan emel anda sekali lagi untuk pengesahan",
email: "Sila masukkan alamat emel yang sah",
equalTo: "Emel yang dimasukkan untuk pengesahan tidak sama dengan emel yang dimasukkan di atas"
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment