Jump to content


Photo

Echo into text area


  • Please log in to reply
5 replies to this topic

#1 avo

avo
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • Locationstaffordshire uk

Posted 02 April 2006 - 09:13 PM

HI All

Can Anyone help me out here please

what im trying to do is read a database entry into a text area not a text box as this i can do but what i need to do is read into a txt area then be able to write in it to submit it back to the db .

this is my code

<table width="100%" height="116" border="0" id="head">
    <tr>
<tr class="mTr"><td><p> </p>
    <p>Web site</p></td><td>
      <textarea rows="10" name="S1" value="<? echo $profile->web; ?>cols="20"></textarea></td></tr>    
    </tr>
</table>

it works with this code

<table width="100%" height="116" border="0" id="head">
    <tr>
    <tr class="mTr"><td>Web Site</td><td>
      <input type="text" name="hometel" value="<? echo $profile->web; ?>"></td></tr>    
      
    </tr>
</table>

but i need a large area to type in and submit back my database is set up with longtext if you do need to know


thanks in advance.
Im loving it ........

#2 earl_dc10

earl_dc10
  • Members
  • PipPipPip
  • Advanced Member
  • 71 posts

Posted 02 April 2006 - 09:35 PM

Im not sure if textarea's can have "values", try this as a test
<textarea rows="10" cols="20" name="S1" value="It Works"></textarea>

just another thing I noticed, you had your "cols" value inside of the "value" tag quotes, but try that.
got a problem? Google helps many of those in need

#3 Pezzoni

Pezzoni
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 02 April 2006 - 09:47 PM

Try:
<table width="100%" height="116" border="0" id="head">
    <tr>
<tr class="mTr"><td><p> </p>
    <p>Web site</p></td><td>
      <textarea rows="10" name="S1" cols="20"><? echo $profile->web; ?></textarea></td></tr>    
    </tr>
</table>

Also don't forget to do the normal processing you would do on the data for display (stripslashes etc), or things might start getting strange.

#4 sford999

sford999
  • Members
  • PipPipPip
  • Advanced Member
  • 119 posts

Posted 02 April 2006 - 10:47 PM

If you can get away with renaming the textarea for the update then you could use something like

<table width="100%" height="116" border="0" id="head">
    <tr>
<tr class="mTr"><td><p> </p>
    <p>Web site</p></td><td>
      <textarea rows="10" name="S1" cols="20">$name_here</textarea></td></tr>    
    </tr>
</table>

I did it with a script of mine example below

echo "<tr>
        <td class=\"content\">Address/Location</td>
        <td class=\"content\"><textarea name=\"addr_ud\" cols=\"60\" rows=\"4\">".$addr."</textarea>
        </td>
</tr>";


#5 txmedic03

txmedic03
  • Members
  • PipPipPip
  • Advanced Member
  • 313 posts
  • LocationCall, TX, USA

Posted 03 April 2006 - 08:28 AM

[!--quoteo(post=360979:date=Apr 2 2006, 04:35 PM:name=earl_dc10)--][div class=\'quotetop\']QUOTE(earl_dc10 @ Apr 2 2006, 04:35 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Im not sure if textarea's can have "values", try this as a test
<textarea rows="10" cols="20" name="S1" value="It Works"></textarea>

just another thing I noticed, you had your "cols" value inside of the "value" tag quotes, but try that.
[/quote]

No there is no value parameter for textarea elements.

SEMPER FIDELIS!

I can't stop you from doing something silly, but at least I can help you do it right.


#6 Desdinova

Desdinova
  • Members
  • PipPipPip
  • Advanced Member
  • 41 posts

Posted 03 April 2006 - 08:48 AM

[!--quoteo(post=360984:date=Apr 2 2006, 11:47 PM:name=Pezzoni)--][div class=\'quotetop\']QUOTE(Pezzoni @ Apr 2 2006, 11:47 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Try:
<table width="100%" height="116" border="0" id="head">
    <tr>
<tr class="mTr"><td><p> </p>
    <p>Web site</p></td><td>
      <textarea rows="10" name="S1" cols="20"><? echo $profile->web; ?></textarea></td></tr>    
    </tr>
</table>

Also don't forget to do the normal processing you would do on the data for display (stripslashes etc), or things might start getting strange.
[/quote]

what he said




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users