Jump to content

Didplay into a textarea


firedrop84

Recommended Posts

Example:

... name="var_name" value="<?PHP echo $my_value; ?>" ...

Look into perhaps using htmlentities() depending on what you're putting in the value area:

[a href=\"http://us3.php.net/htmlentities\" target=\"_blank\"]http://us3.php.net/htmlentities[/a]

Link to comment
Share on other sites

[!--quoteo(post=358524:date=Mar 26 2006, 09:46 AM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ Mar 26 2006, 09:46 AM) [snapback]358524[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Example:

... name="var_name" value="<?PHP echo $my_value; ?>" ...

Look into perhaps using htmlentities() depending on what you're putting in the value area:

[a href=\"http://us3.php.net/htmlentities\" target=\"_blank\"]http://us3.php.net/htmlentities[/a]
[/quote]


I may be incorrect on this, so catch me if I am toplay. But I didnt think you could declare a "value=" for a text area. I know you can with a text input field. See the snippet below:

[code]
    <body>
        <P>My Text Field</P>
        <P><INPUT id="Text1" type="text" name="Text1" value="<? echo $solution; ?>"></P>
        <P> </P>
        <P>My Text Area</P>
        <P><TEXTAREA id="Textarea1" name="Textarea1" rows="2"                 cols="20"><? echo $myvar; ?></TEXTAREA></P>
    </body>
[/code]

As I said, I may be wrong, but I have never been able to use the "value=" parameter for a TEXTAREA. This always works.
Link to comment
Share on other sites

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]As I said, I may be wrong, but I have never been able to use the "value=" parameter for a TEXTAREA. This always works.[/quote]Beacuse the textare tag is not part of the <input> tag family and so has an opening and closing tag just like the paragraph tag.
Link to comment
Share on other sites

I didn't take firedrop question literally. Yes, that's what you would do with a text area.

FYI: If you have html to display in the input/textarea or any characters that could get interpreted as part of the html syntax (i.e. <), then it's best to do: echo htmlentities($var);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.