javascript - onClick remote validation for dropdown field -
i using jquery remote validation on drop-down field check whether selected field exists or not. overall code working fine , validates properly. issue remote validation sending ajax phone call after onchange event, means showing unique key validation error after clicking anywhere on page.
i want validate 1 time user clicks on dropdown option. tried onclick:true it's not working. please check code:
$("#myform").validate({ // onclick:true, // onkeyup:true, rules: { "customer[customer_personal_details_id]": { required: true, remote: { url: "/validation/check", type: "post", data: { columnval: function () { homecoming $("#customer_customer_personal_details_id").val(); } } } } }, messages: { "customer[customer_personal_details_id]": { required: "please select business relationship holder", remote: "one active business relationship exists. duplicate accounts not allowed."} } }); thanks. help appreciated.
try - assuming have <select id="dropdown_id">
$('#dropdown_id').on('click', function() { $("#myform").validate(); }); javascript jquery ajax validation remote-validation
No comments:
Post a Comment