Views: 21.7K
Replies: 2
Archived
|
Placeholder use with Html.TextBoxForHi guys,
I'm testing Spark 4.5 solution. I noticed that when I load SignUp.cshtml form I don't see the placeholder text. Why? The code is as follows: @Html.TextBoxFor(m => m.Email, new { placeholder = "Email" }) Vito Iacono, Sep 05, 2013
|
|
Reply 1Hello Vito:
I assume you're using an older browser, such as IE 9 or below. They do not support the placeholder attribute. You did the right thing by including jquery.placeholder.js to get the effect. BTW: here is a link of all browsers that support placeholder: http://caniuse.com/input-placeholder Hope this helps. Jack Jack Poorte, Sep 05, 2013
|
|
Reply 2To answer my own question, here is what I did:
I added the jquery.placeholder.js plugin and this code to app.js $(function () { $('input, textarea').placeholder(); }); And now I can see placeholders on the input boxes! Great. Vito Iacono, Sep 05, 2013
Thank you Danut. I shall work towards MVVM pattern adoption.
- ursri
Jun 01, 2012
|