• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

mvc, jquery, validation

I am using MVC + System.ComponentModel.DataAnnotations for my web app.
And I am also using razor htmlhelper for the frontend code

So when the validation is fired, mvc will generate the codes as follow.
Everything is working except for example, if the textbox is empty, it will fire up
the validation message but it is always create new line. so I try to add style
float:left inside of the .field-validation-error and try to make the validation message align with the <label></label>
but it is still not working. Can you show me what I can do?

    color: #ff0000;

<div class="control-group">
                      <label class="control-label" for="firstName">First Name<span class="form-required" title="This field is required."> *</span></label>  
                      <span class="field-validation-error">Required</span>                      
1 Solution
StephanLead Software EngineerCommented:
I don't see the textbox in your generated code and can you also give some css about the control-group, control-label and form-required?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now