By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,404 Members | 1,987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,404 IT Pros & Developers. It's quick & easy.

text within textarea shifted after redisplay form

P: n/a
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

Jun 14 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In article <11********************@g10g2000cwb.googlegroups.c om>,
ru****@belgacom.net says...
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


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

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

GM

Jun 14 '06 #2

P: n/a
Rik
rukkie wrote:
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 ?


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><?php echo $_REQUEST['Observ'] ;?></textarea>

Grtz,
--
Rik Wasmus
Jun 14 '06 #3

P: n/a

Geoff Muldoon schreef:
In article <11********************@g10g2000cwb.googlegroups.c om>,
ru****@belgacom.net says...
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


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

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

GM


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

Jun 14 '06 #4

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

Jun 14 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.