[Display(Prompt MVC3

后端 未结 3 2051
南方客
南方客 2021-01-01 02:31

I am trying to setup my model so I can use the @Html.EditorFor(e => e.publicationTitle) and have it show a Watermark with a hint.

Currently I am do

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-01 02:50

    The placeholder attribute is not supported in earlier versions of IE, so for the Display[(Promt="...")] to work fine I recommend to use (along with the String template as Samack described) any jQuery watermark plugin (I used the google one) then add this to the Document.Ready function:

    $(document).ready(function(){
        $(':text').watermark({ textAttr: 'placeholder' });
    })
    

提交回复
热议问题