javascript alert message box

Hello.  I am currently taking a JavaScript class and I have learned how to create alert box this week :)  I am curious that if there's a way to expand the number of characters allowed for these type of boxes for a long message to still show?
A friend of mine mentioned me about my other question of the positioning of alert box, he mentioned me that I need to use css and create modal popups and overlays.  Can I use the same method?

Thank you for your help in advance.
Who is Participating?
michael_madsenConnect With a Mentor Commented:
The maximum lenth of characters in an alert message is 199 chars (at least for IE). I'm quite sure there is no way to extend that.

There is no way to position the alert box.

To create a modal dialog using CSS and layers, see this article:
Mark BradyPrincipal Data EngineerCommented:
Yes you can use a messagebox in the form of a prompt. It is more flexible than javascripts "alert()" function. I think you can have up to 1024 characters in a prompt message so that would make things a bit easier for you don't you think.


See the example and explanation here.
Michel PlungjanIT ExpertCommented:
Elvin: VBScript is not javascript. Please do not introduce IE-only VBScript to a student of JavaScript :)


Firefox 4 has by the way gotten scrollbars in its alert :)

jQuery UI Dialog is also an option, so is the buildt-in showModalDialog
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Mark BradyPrincipal Data EngineerCommented:
I've got no idea what you meant by your comments.
Michel PlungjanIT ExpertCommented:
@Elvin: The asker is studying JavaScript and asks about a JavaScript issue.
You present him with a VBScript solution which is irrelevant since this is a JavaScript question.


Comparison of JavaScript and VBScript


Both languages are easy to learn and do not require any expensive development tools
Both can be used to enhance web pages
They run on client machines and can substitute CGI programs to reduce server loads
Both can abuse and run malicious scripts on clients' machines


JavaScript is the default scripting language for browsers but VBScript must be specified as the scripting language.
JavaScript has cross-platform support from all popular browsers while VBScript is supported MS IE only. VBScripters would thus lose a sizable audience.

Mark BradyPrincipal Data EngineerCommented:

Fair comment by the asker posted this:

 I am curious that if there's a way to expand the number of characters allowed for these type of boxes for a long message to still show?

Now as I am from English decent that means he/she wants to know if there is a way to make larger messages in a messagebox. They did not ask that the answer MUST be in javascript. If that is the requirement for the question it should has been posted that way. I help people achieve a goal in any way I can. When people post in the PHP forum about how to achieve something like posting a form without refreshing, would you expect us experts to only supply the answer in Php code? I didn't think so. thanks for your comments but I think they are unwarranted in this case. I will excuse myself from this question and any more comments.
Michel PlungjanIT ExpertCommented:
No need to be offended, no offense intended. Just read the title, the tags and the first line of the question again. I could suggest to dowload webkit, change the size of the alert box and recompile a personalised browser. Valid suggestion but not relevant :)

I believe your question has been answered. If you disagree, please comment.
sabregirlAuthor Commented:
Thank you for everyone who left comments for me :)  I have learned something new...
Michel PlungjanIT ExpertCommented:
A split would have been nice... :)
sabregirlAuthor Commented:
Sorry mplungjan.  I will keep in mind next time!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.