Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
24
rated 0 times [  26] [ 2]  / answers: 1 / hits: 51151  / 13 Years ago, wed, august 31, 2011, 12:00:00

Is there anyway to make the textbox/input box in prompt multiline?


More From » prompt

 Answers
15

No, browsers only allow single-line input for prompt(). However, with a simple change to the jQuery Alert Dialogs library you could get multi-line input there. Take jquery.alerts.js, look for <input type="text" size="30" id="popup_prompt" /> and replace it by <textarea rows="5" cols="30" id="popup_prompt"></textarea>. That should do to have a multi-line input field show up when calling jPrompt().


Edit: As Mulletfingers999 points out in a comment, jQuery Alert Dialogs have been deprecated in favor of jQuery UI dialogs. There you can also show a "modal" dialog, that dialog can have arbitrary content however - meaning that a <textarea> tag is possible if you want multi-line input.


[#90335] Monday, August 29, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lewis

Total Points: 739
Total Questions: 100
Total Answers: 94

Location: Nepal
Member since Mon, Jan 4, 2021
3 Years ago
;