Magento Forum

how to make this validation error goes away
Total Posts:  1144
Joined:  2007-08-31

I almost tempting to post this in Suggestion and Feedback forum… but this really isn’t something that important to many people and causes no functionality issue.

Anyhow, I would like to know how to get this fix myself.

In the Onepage checkout > Billing Information, in Country section attribute, it generates these codes:

<label for="billing:country_id">Country <span class="required">*</span></label><br/>
select name="billing[country_id]" id="billing:country_id" class="validate-select" title="Country" ><option value="" [b]selected[/b]></option><option value="US">United States</option>

It can’t pass the markup validation because of the “selected” in the <option value="” selected></option>.

the name and VI delimiter can be omitted from an attribute specification only if SHORTTAG YES is specified.

…="Country" ><option value="” selected></option><option value="US">United Stat

“VI delimiter” is a technical term for the equal sign. This error message means that the name of an attribute and the equal sign cannot be omitted when specifying an attribute. A common cause for this error message is the use of “Attribute Minimization” in document types where it is not allowed, in XHTML for instance.

How to fix: For attributes such as compact, checked or selected, do not write e.g <option selected ... but rather <option selected="selected" ...

I want to change <option value="” selected></option> to <option value="” selected="selected">, but I am unable to change it from the ‘billing.phtml’ page.  I see the code being called from ‘Mage > Checkout > Onepage > Abstract.php, in line 141:


What do I need to add?


Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top