text within textarea shifted after redisplay form

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

    #1

    text within textarea shifted after redisplay form

    After a redisplay of the form, caused by errors in other fields, the
    text which is in the "Observ" textarea is shifted (some 8 places) to
    the right (and this each time after a redisplay). The code used in case
    of redisplay is :

    <tr>
    <td align="right">
    Observations :
    </td>
    <td>
    <textarea align="left" cols="50" rows="10" name="Observ">
    <? echo $Observ ;?></textarea>
    </td>
    </tr>

    Does anyone has a clue what is causing the shift and how to solve it ?

    Thanks in advance

  • Geoff Muldoon

    #2
    Re: text within textarea shifted after redisplay form

    In article <1150268145.774 485.6690@g10g20 00cwb.googlegro ups.com>,
    rukkie@belgacom .net says...[color=blue]
    > After a redisplay of the form, caused by errors in other fields, the
    > text which is in the "Observ" textarea is shifted (some 8 places) to
    > the right (and this each time after a redisplay). The code used in case
    > of redisplay is :
    >
    > <tr>
    > <td align="right">
    > Observations :
    > </td>
    > <td>
    > <textarea align="left" cols="50" rows="10" name="Observ">
    > <? echo $Observ ;?></textarea>
    > </td>
    > </tr>
    >
    > Does anyone has a clue what is causing the shift and how to solve it ?
    >
    > Thanks in advance[/color]

    <textarea blah blah><? echo $Observ ;?></textarea>

    All on one line. The HTML is including the indent whitespace of your code.

    GM

    Comment

    • Rik

      #3
      Re: text within textarea shifted after redisplay form

      rukkie wrote:[color=blue]
      > After a redisplay of the form, caused by errors in other fields, the
      > text which is in the "Observ" textarea is shifted (some 8 places) to
      > the right (and this each time after a redisplay). The code used in
      > case of redisplay is :
      >
      > <tr>
      > <td align="right">
      > Observations :
      > </td>
      > <td>
      > <textarea align="left" cols="50" rows="10" name="Observ">
      > <? echo $Observ ;?></textarea>
      > </td>
      > </tr>
      >
      > Does anyone has a clue what is causing the shift and how to solve it ?[/color]

      Not without the cause of the errors.
      Perhaps usefull pointers:
      - using <?php is preferred instead of <?
      - what does $_REQUEST['Observ'] do?
      - are there any actions/errors which can alter $Observ?
      - PHP has nothing to do with displaying, that's all HTML (/&CSS), so, what
      does you HTML source say?
      - I definitely count 8 spaces before <?, so displaying a linebreak, and 8
      spaces, may be just correct behaviour.

      In short:
      What does this code do:
      <textarea><?p hp echo $_REQUEST['Observ'] ;?></textarea>

      Grtz,
      --
      Rik Wasmus


      Comment

      • rukkie

        #4
        Re: text within textarea shifted after redisplay form


        Geoff Muldoon schreef:
        [color=blue]
        > In article <1150268145.774 485.6690@g10g20 00cwb.googlegro ups.com>,
        > rukkie@belgacom .net says...[color=green]
        > > After a redisplay of the form, caused by errors in other fields, the
        > > text which is in the "Observ" textarea is shifted (some 8 places) to
        > > the right (and this each time after a redisplay). The code used in case
        > > of redisplay is :
        > >
        > > <tr>
        > > <td align="right">
        > > Observations :
        > > </td>
        > > <td>
        > > <textarea align="left" cols="50" rows="10" name="Observ">
        > > <? echo $Observ ;?></textarea>
        > > </td>
        > > </tr>
        > >
        > > Does anyone has a clue what is causing the shift and how to solve it ?
        > >
        > > Thanks in advance[/color]
        >
        > <textarea blah blah><? echo $Observ ;?></textarea>
        >
        > All on one line. The HTML is including the indent whitespace of your code.
        >
        > GM[/color]

        Thanks for the quick response. Getting rid of the indent is solvind the
        problem !!!

        Comment

        • the DtTvB

          #5
          Re: text within textarea shifted after redisplay form

          Data should be htmlspecialchar ()ed also if used in textarea.
          It prevents user from entering '</textarea>' and break the form.

          Comment

          Working...