confirmation box question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Herrman

    confirmation box question

    Hi all,

    i'm quite new to javascript and can't find the answer on the net, but
    sorry if i'm going to ask a stupid question :-)

    I am programming in PHP. The PHP code makes a message which I want to show
    in a confirmation box using javascript. The message can be quite large
    (about 300 characters) and thus does not fit on one line. I noticed that
    although the HTML source file shows a complete text, the confirmation box
    does not; the end of the text is lost.

    Is it possible to automatically show the text on multiple lines, or should
    I manually add newline characters (how?) ?

    thanks a lot in advance,

    Martin
  • Marek A. Stepien

    #2
    Re: confirmation box question

    Martin Herrman wrote:[color=blue]
    > Is it possible to automatically show the text on multiple lines, or should
    > I manually add newline characters (how?) ?[/color]

    Just use the \n special character:

    confirm("This is the first line\nand this is the second one.");

    --
    | Marek A. Stepien | marcoos dot org | Linux user #153004 |
    | Powered by Mozilla Thunderbird. Your mail, your way. |

    Comment

    • Chris Riesbeck

      #3
      Re: confirmation box question

      Martin Herrman <m.herrman@stud ent.tue.nl> wrote in message news:<pan.2003. 11.13.15.30.40. 375749@student. tue.nl>...[color=blue]
      >
      > I am programming in PHP. The PHP code makes a message which I want to show
      > in a confirmation box using javascript. The message can be quite large
      > (about 300 characters) and thus does not fit on one line. I noticed that
      > although the HTML source file shows a complete text, the confirmation box
      > does not; the end of the text is lost.
      >
      > Is it possible to automatically show the text on multiple lines, or should
      > I manually add newline characters (how?) ?[/color]

      confirm("line one\nline two")

      Comment

      Working...