I have a remote verification setting
remote: { type: "POST", url: "/some/url", data: { value: function() { return $("#field").val(); }, bypass: function() { if ($("input:radio[name=toggleBypass]:checked").val() == "yes"){ return "yes"; } return "no"; } } }
If the bypass is yes, ajax always returns true.
It works when blurring and when sending, but if I reset the value of the radio button, then send it, it will not revalidate.
For instance,
- Set toggleBypass to "yes"
- Specify a field for an invalid value
- Run $ ("form"). validate (). element ("# field"). Since the bypass is yes, it passes.
- Set toggleBypass to "no"
- Run $ ("form"). validate (). element ("# field"). It passes because the remote has not resent.
Any ideas how I can make it work correctly?
source share