views:

131

answers:

0

I have a textbox..

<input id="state" name="state" type="text" value="" />

And I'm trying to add a remote rule to it.

<%= Html.ClientSideValidations()
    .AddRule("state", new RemoteRule(Url.Action("ValidateNeedForState")))%>

In that remote action I want to see if the country is "US" and if so, make sure there is a state provided. This rule only fires when I actually enter a state. If I try to submit without entering a state, it posts and I pick up the problem on server side, but I feel I should be able to test this rule before submitting the form. Is this possible?