Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
17107 มุมมอง

How to insert line break in placeholder in text area field?

 

อวตาร
ละทิ้ง

Hello ,

You get any solution because i am facing similar problem.

คำตอบที่ดีที่สุด

I am surprised no one came up with a working solution in the last 9 years.

You can simply add & # 1 0 ; (without spaces) to your placeholder text, browser will register it as line feed.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Is it possible ?? ;) Have you tried \n \r ?

อวตาร
ละทิ้ง
ผู้เขียน

yes tried that didn't work.

คำตอบที่ดีที่สุด

Only by formatting with multiple spaces, e.g.:

1st line of placeholder starts here                                         2nd starts here            etc    

If the size of textarea is fixed, browsers will show such long texts as if they were on multiple lines.

You'll have to fine-tune the number of spaces to make placeholder text look as you like.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 16
4399
0
ก.ค. 16
5280
1
ธ.ค. 15
3861
1
พ.ย. 15
5267
1
ม.ค. 24
15863