Skip to main content
HTML Validation

Bad value “virtual” for attribute “wrap” on element “textarea”.

About This HTML Issue

Invalid value “virtual” was used for the wrap attribute on a textarea.

The wrap attribute controls how the browser wraps text when submitting a form. It accepts only two keyword values:

  • soft (default): Lines are not hard-wrapped on submission; the server receives unwrapped lines.
  • hard: The browser inserts CRLFs at wrap boundaries on submission; you must also set cols for hard to be valid.

virtual was a non-standard value used by some legacy browsers and is not allowed by the HTML Standard or the W3C validator. Remove wrap entirely to get soft wrapping, or set it to soft/hard as needed. If you choose hard, include a sensible cols value. You can also control visual wrapping with CSS like white-space if needed.

HTML Examples

Example: Reproduces the validator error

<!doctype html>
<html lang="en">
<head>
  <title>Textarea Wrap Error</title>
</head>
<body>
  <form>
    <label for="msg">Message</label>
    <textarea id="msg" name="msg" wrap="virtual"></textarea>
  </form>
</body>
</html>

Example: Valid fixes

<!doctype html>
<html lang="en">
<head>
  <title>Textarea Wrap Fix</title>
</head>
<body>
  <form>
    <label for="msg-soft">Message (soft)</label>
    <textarea id="msg-soft" name="msg" wrap="soft"></textarea>

    <label for="msg-hard">Message (hard)</label>
    <textarea id="msg-hard" name="msg" wrap="hard" cols="40" rows="5"></textarea>
  </form>
</body>
</html>

Last reviewed: August 19, 2025

Was this guide helpful?

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Ready to validate your sites?
Start your free trial today.