I am having trouble validating this form in HTML5. I am down to my final error, and am coming up with nothing!!! Hope someone can help!
The section of the form that is causing the error
<textarea name="content" value="<?=$content;?>" class="rounded" <?php echo $_POST['content'] ? $_POST['content'] : "" ?> required="required"></textarea>
This is the error that the W3C Validator is pulling up!
Error Line 177, Column 78: Attribute value not allowed on element textarea at this point.
…xtarea name="content" value="" class="rounded" required="required"></textarea>
The error is on the closing > after the required=”required”
Again hopefully someone can help!! 🙂
– ANSWER FOUND –
OK! for anyone who may need the answer to the above question…
The textarea should read, to pass W3C validation
<textarea name="content" class="rounded" <?php echo $_POST['content'] ? $_POST['content'] : "" ?> required="required"><?=$content;?></textarea>
This will still allow the form to stay populated after submit..
There is no
valueattribute for<textarea>. Put your content inside the<textarea>container.Sample:
References: