?
Solved

javascript alert message box

Posted on 2011-03-20
11
Medium Priority
?
813 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:sabregirl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 2

Accepted Solution

by:
michael_madsen earned 1500 total points
ID: 35177213
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: http://www.explainth.at/en/css/dlg.shtml
0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35177427
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.

MsgBox(prompt[,buttons][,title][,helpfile,context]);

See the example and explanation here.
http://www.w3schools.com/VBScript/func_msgbox.asp
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 35178281
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
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 20

Expert Comment

by:Mark Brady
ID: 35179125
I've got no idea what you meant by your comments.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 35179141
@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.

From http://uopteamc.tripod.com/javavb.html

Comparison of JavaScript and VBScript

Similarities

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
   

Differences

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.
   

0
 
LVL 20

Expert Comment

by:Mark Brady
ID: 35185683
mplungjan:

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.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 35186678
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 :)
0
 
LVL 2

Expert Comment

by:michael_madsen
ID: 35211216
sabregirl:

I believe your question has been answered. If you disagree, please comment.
0
 

Author Closing Comment

by:sabregirl
ID: 35220625
Thank you for everyone who left comments for me :)  I have learned something new...
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 35220844
A split would have been nice... :)
0
 

Author Comment

by:sabregirl
ID: 35221013
Sorry mplungjan.  I will keep in mind next time!
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question