Solved

Using MVC How Do You Show Light Itacics Text in a Text Box?

Posted on 2014-09-22
2
122 Views
Last Modified: 2014-09-25
Using MVC how do you show light Italics text in a text box that goes away after you type?

Is there a way to use a placeholder?

Thanks,

Dan
0
Comment
Question by:danielolorenz
2 Comments
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 500 total points
ID: 40338366
Yes, You can  do it using placeholder.
There's an option with HTML 5 to specify a placeholder.

<input name="name" type="text" placeholder="Your name...">
@Html.TextBoxFor(m => m.Name, new { placeholder="Your Name..." })

How ever this is not supported in all the browser so you can do it using java script. Please check the link below:
https://github.com/mathiasbynens/jquery-placeholder

If you are using Ajax Toolkit in your project you can do it using TextBoxWatermark
http://www.ajaxcontroltoolkit.com/TextBoxWatermark/TextBoxWatermark.aspx
0
 

Author Closing Comment

by:danielolorenz
ID: 40344261
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now