Setting value of a HTML form textarea?

后端 未结 3 1069
没有蜡笔的小新
没有蜡笔的小新 2020-11-27 21:32

I\'m using the following to set the value of a text area..



Description
相关标签:
3条回答
  • 2020-11-27 21:57

    Also you can use this method...

     `<textarea  rows="12" id="mytextarea"><?php echo $bio; ?> </textarea>
    
      <script>
      document.getElementById(`mytextarea`).innerHTML="Include the text you want to display";
      </script>`
    
    0 讨论(0)
  • 2020-11-27 22:15

    Textarea has no value. You need to insert your message between the opening and closing tags.

    <textarea><?php echo htmlspecialchars($message); ?></textarea>
    
    0 讨论(0)
  • 2020-11-27 22:15
    <textarea name="message" cols="40" rows="6"><?=$message?></textarea>
    

    Note: Make sure $message is properly sanitized and that short_open_tag is enabled. Otherwise, @fabric's accepted answer is a better answer.

    0 讨论(0)
提交回复
热议问题