Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7823127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:08:11+00:00 2026-06-02T08:08:11+00:00

mvc3 DataAnnotations has a Description attribute: e.g. [Display (Name=Title, Description=description about the title)] public

  • 0

mvc3 DataAnnotations has a Description attribute:

e.g.

[Display (Name="Title", Description="description about the title")]
public string Title { set; get}; 

in my view, I want to use jquery on .blur show the Description text that was entered.

<script type="text/javascript">
   $(function () {
     $("#title").blur(function () {
        ???
    });
});

@Html.LabelFor(model => model.Title)
//description here, not sure how to map it.
@Html.LabelFor()//description would go here
@Html.TextBoxFor(model => model.Title)
@Html.ValidationMessageFor(model => model.Title)

thx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T08:08:14+00:00Added an answer on June 2, 2026 at 8:08 am

    I dont think adding Description will add a title tag to your input element. You may probably want to mention that when you create the text box like this

    @Html.TextBoxFor(model => model.Title, new {@title="Your description"})
    

    that will generate a title tag for your input element and as minus4 mentioned, you can use jQuery to access that.

    $(function () {
      $("#Title").blur(function () {
           alert($(this).attr("title"));
      });        
    });
    

    You probably want to use a generic selector instead of specific selector (ID), something like a class name of all those input elements

    EDIT : based on the comment about generic selector and specific selector

    ID should be unique for each element, So If you have 8 elements, there will (and should) be 8 unique ids for the elements. in that case, you need to bind your function to 8 different items by ID like this

       $("#Title,#Name,#City,#JobTitle,#SomeOther,#LastName,#Hi,#Ho").blur(function () {
               alert($(this).attr("title"));
        });  
    

    But if you have a common class which is being applied to all these elements , you may use it like that (The below will bind the function to all elements which has the css class value mySimpleClass

       $(".mySimpleClass").blur(function () {
               alert($(this).attr("title"));
        });
    

    You may use the other selectors like Child selectors. (The below code will bind your functionality to all input element of type text which is present in the divContainer div

       $("#divcontainer input type[text]").blur(function () {
               alert($(this).attr("title"));
        });
    

    To Add the Css class to your input element while using Html.TextBox for HTML helper, you may use it like this

    @Html.TextBoxFor(model => model.Title, new {@title="Your description", @class="mySimpleClass"})
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In MVC3 (.Net) it is possible to set a Bind Attribute on a parameter
Using MVC3 and the StringLength validation attribute on a property of type MyType<string> who's
I consume an API that has a full object set. I don't want to
Environment: MVC3 SqlMemberShipProvider I added an empty public void Application_AuthenticateRequest(object sender, EventArgs e) {}
I have an MVC3 program in which I want to query a database and
I have an MVC3 application that has a custom HandleErrorAttribute so that I can
If an MVC3 application (an example project name - SuperApp.Web) is relying on a
The DisplayAttribute in System.ComponentModel.DataAnnotations has a GroupName property, which allows you to logically group
I just created a sample MVC3 application to learn validation. It is using DataAnnotations.
With MVC3, should I design my view models such that there is one that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.