Validation Message After Submit Button
net MVC3 i'm using Following code for Submit button
<tr><td colspan="13">
<div style="text-align:center; float:inherit;"><input
id="srch" type="submit" class="btnInput"
value=@Model.lstCommonLabels.btnSubmit
onclick="javascript:Dispalymaingrid();" /><label
style="color:Red; float:inherit;"
id="lblvalidation"></label></div>
</td>
</tr>
and i'm giving validation using following code,
if(Geo == "" || Vertical == "" || Month == "")
{
document.getElementById('lblvalidation').innerText =
"Mandatory Fields should be selected";
return false;
}
if(Month == "" || Month == 0)
{
document.getElementById('lblvalidation').innerText =
"Mandatory Fields should be selected";
return false;
}
When this validation works the position of Button field changes and the
validation message getting displayed.i want the validation message to be
displayed after the button without changing its position.which html tag i
can use?
No comments:
Post a Comment