You are viewing limited content. For full access, please sign in.

Question

Question

placeholder multiline field

asked on November 3, 2015

Hello,

I know the syntax for placeholder is: $(".email input").attr("placeholder", "example@email.com");

 

How would I be able to put 2 or more placeholder texts if I have a multiline field?

 

Regards,

Sahil

0 0

Answer

SELECTED ANSWER
replied on November 3, 2015

Hi Sahil,

Make sure to put the '\n' between the text you want on each line. It works for me!

1 0

Replies

replied on November 3, 2015

Hi Sahil,

Try this out: $('.email textarea').attr('placeholder','example1@email.com\nexample2@email.com');

For multi-line fields, the 'input' is 'textarea'. Then you can add a new line with '\n'.

Let me know if this works for you!

1 0
replied on November 3, 2015

You mean two or more lines of placeholder text into a multiline field?

0 0
replied on November 3, 2015

Yes Ege

0 0
replied on November 3, 2015 Show version history

Alex,

(Sorry I wrote Ege earlier)

I tried this:

$("#q140 input").attr("placeholder", "Min: CHF 3'500 - Max: CHF 7'000");
$("#q212 input").attr("placeholder", "Min: CHF 3'500 - Max: CHF 7'000\n what the hell is this");

The field 140 is single line & works, 212 is Multiline & doesn't work :(  

 

0 0
replied on November 3, 2015

Alex,

I'm sorry, think I went blind for a minute.

Works Perfectly, Awesome!!!

Only problem is it doesn't do line break, so adds text in the same line.

 

Any chance to say when to create text in next line?

0 0
replied on November 3, 2015

I have same, but no luck :(

Screen Shot 2015-11-03 at 17.39.32.png
0 0
replied on November 3, 2015

Alex,

It seems to work on IE, but not on Safari or Firefox on mac???

Any ideas?

0 0
replied on November 3, 2015

Guess, it's because I have El Capitan...... Since Steve has died, Mac is shit.

Sorry about the trouble & Again, Thanks!!!!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.