but In some cases I need to fire it manually on a dropdown change event.
The ddl value is send in AdditionalField for the remote validation, so when I change the DDL value I want to fire the remote validation in the textbox.
Now the remote validator only fires when I type something in the textbox (standard behavior).
Any way or workaround to fire the validator? I tried changing the textbox value, also used focus, blur, trigger the change event on the textbox but didn't work.
mspasiuk
0 Points
3 Posts
Manually trigger a remote validator by JQuery/javascript
Nov 21, 2012 01:33 AM|LINK
Hi All
I've implemented a remote validator for a textbox and works fine.
[Remote("ValidateNumber", "Registration", AdditionalFields = "Country", ErrorMessageResourceName = "InvalidF", ErrorMessageResourceType = typeof(Resource))] public string DocNumber { get; set; }but In some cases I need to fire it manually on a dropdown change event.
The ddl value is send in AdditionalField for the remote validation, so when I change the DDL value I want to fire the remote validation in the textbox.
Now the remote validator only fires when I type something in the textbox (standard behavior).
Any way or workaround to fire the validator? I tried changing the textbox value, also used focus, blur, trigger the change event on the textbox but didn't work.
asteranup
All-Star
30184 Points
4906 Posts
Re: Manually trigger a remote validator by JQuery/javascript
Nov 21, 2012 09:33 AM|LINK
Hi,
You can check this post-
http://stackoverflow.com/questions/5618247/forcing-a-revalidate-on-mvc3-unobtrusive-remote-validation
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog