0

I know how to prepopulate a text area, but I would also like to have certain text in the text area which is there purely to hint at what users should write in a certain section, like:

System      ----- stays in text area to be sent with form
-----------
"Enter this specific type of info here" --- disappears when clicking to edit

Bug         ----- stays in text area to be sent with form
-----------   
"Enter only the bug report" --- disappears when clicking to edit

So only the user added text and the headings like Bug and System would be sent in the form in which the textarea is part of, not the 'help hint' text. Yes, I could have different fields but the client wants it all in one textarea. Cant imagine a pain-free way how to do this.

4

1 に答える 1

0

placeholder 属性の仕事のように聞こえます。

<label for="bug">Bug</label>
<textarea name="bug" id="bug" placeholder="Enter only the bug report"></textarea>

古いブラウザでは機能しませんが、フィールドに入力する必要のないアドバイス情報です。

ライブ デモをご覧ください。

于 2012-09-05T10:05:03.150 に答える