Prompt() in Safari

G

Greg Taylor

Greetings,

I was wondering if there was a way to make prompt() calls in Safari
show a single-line input box instead of the default multi-line prompt
that it currently does.

It seems like most other browsers just provide a single-line prompt
text box, meaning that the user hitting ENTER is the same as them
hitting the "Ok" button. In Safari (where the prompt() calls result in
a multi-line input box), hitting ENTER is interpreted as a new line
return.

This is just a matter of consistency. Some of my less computer savvy
users have been irritated by this and my Googling hasn't turned up a
way to make the prompts single line.
 
D

David Mark

Greetings,

I was wondering if there was a way to make prompt() calls in Safari
show a single-line input box instead of the default multi-line prompt
that it currently does.

No. You are stuck with whatever the browser provides.
It seems like most other browsers just provide a single-line prompt
text box, meaning that the user hitting ENTER is the same as them
hitting the "Ok" button. In Safari (where the prompt() calls result in
a multi-line input box), hitting ENTER is interpreted as a new line
return.

That is irritating. Best not to use prompt at all though. Same for
alert. Some aggressive popup blockers intercept them.
 
R

RobG

Greetings,

I was wondering if there was a way to make prompt() calls in Safari
show a single-line input box instead of the default multi-line prompt
that it currently does.

No, but you can do an imitation of a prompt using script and DOM
elements.

It seems like most other browsers just provide a single-line prompt
text box, meaning that the user hitting ENTER is the same as them
hitting the "Ok" button. In Safari (where the prompt() calls result in
a multi-line input box), hitting ENTER is interpreted as a new line
return.

Not in Safari 3.0.4, it behaves as other browsers do, which is
annoying as it displays a multi-line field but when you press the
return or enter keys to enter another line, it submits.

This is just a matter of consistency. Some of my less computer savvy
users have been irritated by this and my Googling hasn't turned up a
way to make the prompts single line.

Tell them to change browsers or update to Safari 3.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top