Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 05, 2013 12:44 PM by wavemaster
Participant
1351 Points
1162 Posts
Jan 05, 2013 03:29 AM|LINK
I am updating my input forms to version 2 with jquery validation.
The "Event name is required." message appears above Event Name:
I would like it to appear to the right of the input box.
I have looked through my site.css, which is unaltered. Nothing there for "error-label".
Looks like I am missing something, but don't know what.
Validation.RequireField("formName", "Event name is required.");
<form method="post"><table> <tr><td>Event Name:@if (!ModelState.IsValidField("formName")) {<text>class="error-label"</text>}</td> <td><input type="text" id="formName" name="formName" value="@Request["formName"]" class="@Validation.ClassFor("formName")" @Validation.For("formName")/></td></tr> Html.ValidationMessage("formName") <tr><td>Event Location:</td><td><input type="text" name="formLocation" /></td></tr>
Member
408 Points
74 Posts
Jan 05, 2013 04:41 AM|LINK
put you your ValidationMessage, into the td tag
<td><input type="text" id="formName" name="formName" value="@Request["formName"]" class="@Validation.ClassFor("formName")" @Validation.For("formName")/> Html.ValidationMessage("formName") </td> </tr>
Jan 05, 2013 12:44 PM|LINK
Yes!
Thank you.
wavemaster
Participant
1351 Points
1162 Posts
updating validation 1.0 to version 2.0 client side - formatting issues
Jan 05, 2013 03:29 AM|LINK
I am updating my input forms to version 2 with jquery validation.
The "Event name is required." message appears above Event Name:
I would like it to appear to the right of the input box.
I have looked through my site.css, which is unaltered. Nothing there for "error-label".
Looks like I am missing something, but don't know what.
Validation.RequireField("formName", "Event name is required.");saeed_saedva...
Member
408 Points
74 Posts
Re: updating validation 1.0 to version 2.0 client side - formatting issues
Jan 05, 2013 04:41 AM|LINK
put you your ValidationMessage, into the td tag
<td><input type="text" id="formName" name="formName" value="@Request["formName"]" class="@Validation.ClassFor("formName")" @Validation.For("formName")/> Html.ValidationMessage("formName") </td> </tr>Saeed Saedvand
wavemaster
Participant
1351 Points
1162 Posts
Re: updating validation 1.0 to version 2.0 client side - formatting issues
Jan 05, 2013 12:44 PM|LINK
Yes!
Thank you.