add carriage return?!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Geoff Cox

    add carriage return?!

    Hello,

    How do I get a carriage return after each of the names?!

    Cheers

    Geoff

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
    <title>Untitled </title>

    <script>

    var results="";

    var text_0 = new Array(2);
    text_0[0] = "becky";
    text_0[1] = "jim";

    var text_1 = new Array(2);
    text_1[0] = "fred";
    text_1[1] = "susan";

    function save()
    {

    for (var z= 0; z <2; z++)
    {

    for (var i = 0; i < 2; i++)
    {
    results += window["text_" + z][i] + ' ';
    }
    }
    document.write( results);

    }
    </script>

    </head>

    <body>

    <button onclick="save() ">try</button>

    </body>
    </html>

  • Zoe Brown

    #2
    Re: add carriage return?!

    [color=blue]
    > How do I get a carriage return after each of the names?![/color]


    results += window["text_" + z][i] + ' <br>';


    Comment

    • Geoff Cox

      #3
      Re: add carriage return?!

      On Tue, 13 Sep 2005 09:57:16 GMT, "Zoe Brown"
      <zoenaomibrown@ N-O-S-P-A-A-Mtesco.net> wrote:
      [color=blue]
      >[color=green]
      >> How do I get a carriage return after each of the names?![/color]
      >
      >
      > results += window["text_" + z][i] + ' <br>';[/color]

      Zoe,

      That works fine in the code I posted but will not work when I use this
      method when sending data via email using formmail.cgi - any idea what
      to use there?

      Cheers

      Geoff


      Comment

      • ASM

        #4
        Re: add carriage return?!

        Geoff Cox wrote:[color=blue]
        > On Tue, 13 Sep 2005 09:57:16 GMT, "Zoe Brown"
        > <zoenaomibrown@ N-O-S-P-A-A-Mtesco.net> wrote:
        >
        >[color=green][color=darkred]
        >>>How do I get a carriage return after each of the names?![/color]
        >>
        >>
        >>results += window["text_" + z][i] + ' <br>';[/color]
        >
        >
        > Zoe,
        >
        > That works fine in the code I posted but will not work when I use this
        > method when sending data via email using formmail.cgi - any idea what
        > to use there?[/color]

        try :

        \n\r

        or : \\n
        or : \\r
        or : \\n\\r


        --
        Stephane Moriaux et son [moins] vieux Mac

        Comment

        • Mick White

          #5
          Re: add carriage return?!

          Geoff Cox wrote:
          [color=blue]
          > On Tue, 13 Sep 2005 09:57:16 GMT, "Zoe Brown"
          > <zoenaomibrown@ N-O-S-P-A-A-Mtesco.net> wrote:
          >
          >[color=green][color=darkred]
          >>>How do I get a carriage return after each of the names?![/color]
          >>
          >>
          >>results += window["text_" + z][i] + ' <br>';[/color]
          >
          >
          > Zoe,
          >
          > That works fine in the code I posted but will not work when I use this
          > method when sending data via email using formmail.cgi - any idea what
          > to use there?
          >[/color]
          Try "\n" instead of <br> , your server should be able to handle it...
          Mick

          Comment

          • Geoff Cox

            #6
            Re: add carriage return?!

            On Tue, 13 Sep 2005 13:52:35 GMT, Mick White
            <mwhite13BOGUS@ rochester.rr.co m> wrote:
            [color=blue]
            >Try "\n" instead of <br> , your server should be able to handle it...
            >Mick[/color]

            Mick

            I have and no go - have also tried String.fromChar Code() but stll
            cannot separate the parts of the string ... so that they start on new
            lines in the email sent by formmail-nms....

            Cheers

            Geoff

            Comment

            • Robi

              #7
              Re: add carriage return?!

              ASM wrote in message news:4326d934$0 $7852$8fcfb975@ news.wanadoo.fr ...[color=blue]
              > Geoff Cox wrote:[color=green]
              >> On Tue, 13 Sep 2005 09:57:16 GMT, Zoe Brown wrote:
              >>[color=darkred]
              >>>How do I get a carriage return after each of the names?!
              >>>results += window["text_" + z][i] + ' <br>';[/color]
              >>
              >> Zoe,
              >>
              >> That works fine in the code I posted but will not work when I use this
              >> method when sending data via email using formmail.cgi - any idea what
              >> to use there?[/color]
              >
              > try :
              >
              > \n\r
              >
              > or : \\n
              > or : \\r
              > or : \\n\\r[/color]

              Stephane, either you're being ignored, or Geoff thinks you're saying
              the same as he already tried ;-)

              Geoff,

              \n = new line
              \r = carriage return

              you might want to try yhe latter or the combination of both - as in cr/nl

              HTH

              Comment

              • Geoff Cox

                #8
                Re: add carriage return?!

                On Tue, 13 Sep 2005 15:48:29 +0200, ASM
                <stephanemoriau x.NoAdmin@wanad oo.fr.invalid> wrote:
                [color=blue]
                >try :
                >
                > \n\r
                >
                >or : \\n
                >or : \\r
                >or : \\n\\r[/color]

                Stephane

                I have tried all and no go!?

                Cheers

                Geoff

                Comment

                • ASM

                  #9
                  Re: add carriage return?!

                  Geoff Cox wrote:[color=blue]
                  > On Tue, 13 Sep 2005 15:48:29 +0200, ASM
                  > <stephanemoriau x.NoAdmin@wanad oo.fr.invalid> wrote:
                  >
                  >[color=green]
                  >>try :
                  >>
                  >> \n\r
                  >>
                  >>or : \\n
                  >>or : \\r
                  >>or : \\n\\r[/color]
                  >
                  >
                  > Stephane
                  >
                  > I have tried all and no go!?[/color]


                  Ha? yes ! you're right ! :-(

                  try with : %0D%0A

                  because that :

                  <html>
                  <a href="#" onclick="
                  var asm = 'hello,%0D%0A%0 D%0Athere is a little message to%0D%0Asee '+
                  'if return carriages%0D%0A are understood';
                  alert(asm);
                  location.href=' mailto:truc@mac hin.com?'+
                  'subject=saluti a tuti&body='+asm ;
                  return false;
                  ">mail</a>
                  </html>

                  works fine for me at home



                  --
                  Stephane Moriaux et son [moins] vieux Mac

                  Comment

                  • Geoff Cox

                    #10
                    Re: add carriage return?!

                    On Tue, 13 Sep 2005 21:02:50 +0200, ASM
                    <stephanemoriau x.NoAdmin@wanad oo.fr.invalid> wrote:
                    [color=blue]
                    >Ha? yes ! you're right ! :-(
                    >
                    >try with : %0D%0A
                    >
                    >because that :
                    >
                    ><html>
                    ><a href="#" onclick="
                    > var asm = 'hello,%0D%0A%0 D%0Athere is a little message to%0D%0Asee '+
                    > 'if return carriages%0D%0A are understood';
                    > alert(asm);
                    > location.href=' mailto:truc@mac hin.com?'+
                    > 'subject=saluti a tuti&body='+asm ;
                    > return false;
                    > ">mail</a>
                    ></html>
                    >
                    >works fine for me at home[/color]

                    Stephane,

                    Thanks - will give it a try tomorrow - a bit late now - nearly 1am

                    Cheers

                    Geoff

                    Comment

                    • Geoff Cox

                      #11
                      Re: add carriage return?!

                      On Tue, 13 Sep 2005 13:52:35 GMT, Mick White
                      <mwhite13BOGUS@ rochester.rr.co m> wrote:
                      [color=blue]
                      >Try "\n" instead of <br> , your server should be able to handle it...[/color]

                      Mick,

                      Someone has given me the answer!

                      I used escape()

                      ie escape("\n")

                      !!

                      Cheers

                      Geoff




                      Comment

                      Working...