Jump to content

Echo into text area


avo

Recommended Posts

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

[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>[/code]

it works with this code

[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>[/code]

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.
Link to comment
https://forums.phpfreaks.com/topic/6413-echo-into-text-area/
Share on other sites

Try:
[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" cols="20"><? echo $profile->web; ?></textarea></td></tr>    
    </tr>
</table>[/code]

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.
Link to comment
https://forums.phpfreaks.com/topic/6413-echo-into-text-area/#findComment-23245
Share on other sites

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

[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" cols="20">$name_here</textarea></td></tr>    
    </tr>
</table>[/code]

I did it with a script of mine example below

[code]
echo "<tr>
        <td class=\"content\">Address/Location</td>
        <td class=\"content\"><textarea name=\"addr_ud\" cols=\"60\" rows=\"4\">".$addr."</textarea>
        </td>
</tr>";[/code]
Link to comment
https://forums.phpfreaks.com/topic/6413-echo-into-text-area/#findComment-23277
Share on other sites

[!--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) [snapback]360979[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Im not sure if textarea's can have "values", try this as a test
[code]
<textarea rows="10" cols="20" name="S1" value="It Works"></textarea>
[/code]

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.
Link to comment
https://forums.phpfreaks.com/topic/6413-echo-into-text-area/#findComment-23408
Share on other sites

[!--quoteo(post=360984:date=Apr 2 2006, 11:47 PM:name=Pezzoni)--][div class=\'quotetop\']QUOTE(Pezzoni @ Apr 2 2006, 11:47 PM) [snapback]360984[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Try:
[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" cols="20"><? echo $profile->web; ?></textarea></td></tr>    
    </tr>
</table>[/code]

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
Link to comment
https://forums.phpfreaks.com/topic/6413-echo-into-text-area/#findComment-23414
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.