Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - carriage return in message box
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

carriage return in message box

 Post Reply Post Reply
Author
riya_singtel View Drop Down
Newbie
Newbie
Avatar

Joined: 14 March 2005
Location: India
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote riya_singtel Quote  Post ReplyReply Direct Link To This Post Topic: carriage return in message box
    Posted: 17 March 2005 at 2:30am
ok I am using this piece of code:
<%Dim msg
          msg=fun()
          Response.Write("<" & "script language=VBScript>")
          Response.Write("MsgBox """ & msg & """<" & "/script>")
      %>
My function fun() written in ASP Vb script returns a string with characters like "<BR>" to separate lines.Now when the message is displayed in the msg box, it does not show in multiple lines but simply includes the <BR> characters. I understand that I will have to use smth other than <BR> for carriage return. I tried VBCRLF, Chr(13) etc but it returns an error that object is undefined..guess I am missing out on the right syntax to use it..Confused 
 
I tried things like:
disp="This will be displayed" & VBCRLF & "Let's try it"
and
disp="This will be displayed" & '" & VBCRLF & "' & "Let's try it"
 
None work
Can someone help me with it?
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2005 at 2:54am
Try

'This will be displayed \n Let''s try this'
Back to Top
riya_singtel View Drop Down
Newbie
Newbie
Avatar

Joined: 14 March 2005
Location: India
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote riya_singtel Quote  Post ReplyReply Direct Link To This Post Posted: 17 March 2005 at 3:00am
USing single quotes for the string displays syntax error.
If I use \n with double quotes, It still dipalys the string with \n character as it is with the complete string in one line
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2005 at 11:00pm
as far as javascript alerts are concerned, you need to use \r\n to ensure compatability across all browsers. ie doesn't pick up on \n on its own. This should also apply for asp alerts, because it is essentially the same function with a different name.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.