phpxhtmlxhtml-1.0-strictxhtml-transitional

Attribute value is making xhtml page to give error


I have an xhtml page which retrieves a form from an HTML page.When I run the xhtml page it gives me an error.The error is the value attribute which contains the "=","&", sign.What should I do in order to make the xhtml page work with the attribute value.

<input type="hidden" name="return_url" value="index.php?option=com_content&view=article&  id=9&Itemid=&lang=en&msgsent=1" />

Solution

  • An unescaped & sign is an error. So the solution is to escape all the & signs.

    <input type="hidden" name="return_url"
       value="index.php?option=com_content&amp;view=article&amp;id=9&amp;Itemid=&amp;lang=en&amp;msgsent=1" />
    

    This works in HTML as well as XHTML.

    Note: HTML has different error recovery methods than XHTML, which causes the error to be not as bad a problem in HTML as in XHTML. It's still an error though!