tags:

views:

36

answers:

4

var msg = prompt("Type something:") is very useful but it uses a TextField. I would like to have a TextArea instead, so the user can type and see a bigger message. Is it rocket science? Probably not but google did not help. I wish I was a front end guy. :-)

Thanks!

A: 

according to google, there is hope ;)

http://javascript.about.com/library/blmodald1.htm

I think you want the prompt method...

hvgotcodes
I start my question stating that prompt is what I don't want because it has a TextField. :-)
Sergio Oliveira Jr.
ahh -- sorry. Then yeah, i think you are going to have to do what Andir said and use jquery to throw up a window with something in it...
hvgotcodes
A: 

Unfortunately that is not possible out of the box with JavaScript. If you want to do something like that I'd recommend using Ajax to show an HTML/CSS-driven form. It's admittedly more complicated but also way more flexible.

Ash White
+1  A: 

Don't use a prompt, instead use a textarea in a div. There are tons of ways to do this. ;)

If you use something like thickbox and jquery you can put the textarea in a "popup" window that the user can enter text into.

Andir
I find the jQuery UI library a great for this. http://jqueryui.com/demos/dialog/
karlw
+1 karlw. I'm used to using thickbox, but jQueryui would work just as well.
Andir
+1  A: 

If you are wanting a pop up type feeling for this then use a lightbox effect. You can simulate a pop up by using this method and still insert a textarea instead of just using a textfield. You can use something like this.

John