I have this in my view:
@using(Html.BeginForm())
{
<label> Condition Target </label>
<input type="text" name="ConditionTarget1" id="ConditionTarget1"/>
<input type="text" name="ConditionTarget2" id="ConditionTarget2"/>
<br/>
<label> Condition Object </label>
<select name="ConditionObject" id="ConditionObject">
<option value="1"> Condition 1 </option>
<option value="2"> Condition 2 </option>
</select>
<br/>
<input type="submit"/>
}
In my controller (for example):
public ActionResult Validate(int value)
{
return Json(value == 1, JsonRequestBehavior.AllowGet);
}
I want that when conditionobject changes, Validate server method should be called and depending on result conditiontarget text fields must become required (in this case if option 2 is selected). I tried jQuery remote validation but it validates select itself. Can you help me?