Click here to Skip to main content
15,896,450 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to display error message in alert using java scriptr in two lines

and i want to give some styles also lik ebold italic
Posted
Comments
Orcun Iyigun 9-May-13 9:16am    
Why don't you create your own control if you need requirements such that?
[no name] 9-May-13 9:18am    
that is some what urgent so i asked .....

 
Share this answer
 
v2
Hi...

its may helpful to u,try this.
HTML
<button type="submit" onclick="alert('Welcome\n,Ur 1st alertmsg')" style="width: 37px">Hi..</button>


thank u.
 
Share this answer
 
v2
Simplest soluton:
XML
Response.Write("<script type='text/javascript'>");
Response.Write("alert('Add spaces to make it two line and style it here.');");
Response.Write("</script>");
 
Share this answer
 
In javascript, for new line '\n' is used.


For Example: alert("You are entering the wrong value\n example....")


Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900