Link to home
Avatar of salman_sulaiman_2008
salman_sulaiman_2008

asked on

Is there a way to center align the text in the javascript alert box..??

Greetings experts!
In my web application I am using the following lines of code to display a javascript alert box during runtime:
 Dim myalert As String = "alert('Please fill out all fields');"
 Page.ClientScript.RegisterStartupScript(Me.GetType(), "RowHoverScript", myalert, True)

My question is, is there a way to display the text in the Alert box as centered aligned instead of the default left align??

Thanks in advance.
Best Wishes,
~Salman~

SOLUTION
Avatar of Morcalavin
Morcalavin
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of HonorGod
You could add spaces around the string, but this is all a fudge...

e.g., something like:
alert( '        Test()          ' )

Open in new window

This would break on automatic line wraps unless you force the wraps your self and add the appropriate spaces to accommodate.  But like you said, it's all fudge.
alert( '        Test()          ' )

Open in new window

yeah, and I like fudge.... :-)
ASKER CERTIFIED SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of salman_sulaiman_2008
salman_sulaiman_2008

ASKER

Greetings everyone.
Thanks for the replies mates!
I have tried the suggested links, but none of them worked out the way I need, or there were very confusing to implement.

~salman~
Can you post your code?
greetings everyone!
I think I managed to figure out how to use the cutomr alerts offered on
 http://prototype-window.xilinus.com/index.html
Thanks Morcalavin.

~salman~
Greetings everyone!
It turned out that the custom alerts offered by prototype-window.xilins.com works only on firefox mozilla, when I tried to run  the sampe html pages on Internet Explorer, they didn't work. now back to square one.

loqudotcom! actually what I am trying to do is test a custom alert on a fresh project with on Default.aspx page, and once i make sure it works, I'll integrate it into my main project.

~salman~
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.