Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PopUp Windows - How to edit their title & include line breaks? 1

Status
Not open for further replies.

mjrh

Instructor
Jun 2, 2001
34
CA
In DW4's PopUp Message behavior, how do I change the title from "[JasvaScript Application]"? In the DW4 book it says this cannot be done, yet those that pop up while using DW have a customized title?

How do I make the text appear on several lines - i.e., include line breaks? On one website I saw where they used slashes but I cannot figure it out.

Thanks!

:)
 
Hello mjrh!

1) JavaScript specification says: "You cannot specify a title for an alert dialog box". The only thing you may do - to open a new window with specified parameters instead of using alert().

2) to go to next line use \n inside the text:
alert('Attention!!!\n\nThis is a PopUp message\nDo you like it?')

Good Luck!
 
Thank you Eugene.

Your confirmation of part 1 is disappointing, but I guess them's the limits.

Re part 2 - your response helped my figure out what I was doing incorrectly. For any who
have the same problem, here are some details. In DW4 the behaviour is PopUp Message
(not alert). To go to the next line use \r\r such as:

onClick="MM_popupMsg('line one\r\rline two')"

Michel
 
Michel,

1)
\n - Line feed (newline)
\r - Carriage return
Windows require carriage return to line feed - \n\r, but all other platforms need only \n. But in real life \n is enough for Windows as well. So I recoomend to use \n instead of \r.

2)
The example I gave you
alert('some text')
is real Javascript code. What you wrote
onClick="MM_popupMsg('line one\r\rline two')"
is only an event handler. But anyway you put symbols in the right place! The only thing is I would recommend to use \n

Eugene
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top