Solved

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

Posted on 2014-09-22
2
121 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
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)

762 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

17 Experts available now in Live!

Get 1:1 Help Now