javascript - Display the validation popup after select all the compulsary fields -
i have issue filterbutton : when client selects compulsary field grid have filtered otherwise must display popup message : "select compulsary field".
here in fiddle, have 3 dropdowns , 2 datepicker. when select filterbutton filters data, otherwise must show message.in fiddle dropdowns not working grid because didn't placed code between dropdown , grid datetimpicker working.
in this fiddle need display popup validation. here compulsary field in fiddle
code:
if(datetimepicker1 ===""&&datetimepicker2 ==="") { $("#filter-msg").data("kendowindow").center().open(); }
this way tring want validate 5 controls
i suggest add test in click
event of filter
button :
$("#filter").on("click", function () { var mindate = $('#datetimepicker1').data("kendodatepicker").value(); var maxdate = $('#datetimepicker2').data("kendodatepicker").value(); // check if min date has been filled if(!mindate) { alert("you have not filled min date..."); return false; } // check if max date has been filled if(!maxdate) { alert("you have not filled max date..."); return false; } // rest of logic... }
instead of alert
, can put window ($("#filter-msg").data("kendowindow").center().open();
), should keep return false
after in order not filter results...
Comments
Post a Comment