InvalidCharacterError in IE only

◇◆丶佛笑我妖孽 提交于 2019-12-23 09:26:41

问题


We have an order form that uses a ziplookup feature for when a zipcode is entered into a field, the city, county, state and zip are then entered into the same field.

    <tr>
        <td class="formLabel" id="<%=prefix%>.ZipCodeLookup.label">Zip Code</td>
        <td class="formColon">:&nbsp;</td>
        <td class="formData">
            <div id="zipOutput"></div>
            <input type="hidden" id="<%=prefix%>.city" name="<%=prefix%>.city" value="<%=City%>" />
            <input type="hidden" id="<%=prefix%>.county" name="<%=prefix%>.county" value="<%=County %>" />
            <input type="hidden" id="<%=prefix%>.state" name="<%=prefix%>.state" value="<%=State%>" />
            <input type="hidden" id="<%=prefix%>.zip" name="<%=prefix%>.zip" value="<%=Zip %>" />
        </td>
    </tr>

The error on IE only is:

lib.functions.dom.createInput// type=text name=shipping.ZipCodeLookup id=shipping.ZipCodeLookup // InvalidCharacterError

lib.objects.window.LookupWidget.createInputField() // Unable to set property 'value' of undefined or null reference


回答1:


The problem here is probably that you are using a period in the id and name fields of your HTML. IE seems to think that is not valid HTML. Most browsers are more forgiving than IE for this kind of violation. Also note that many frameworks allow it through automatic escaping.

If you remove the period from those fields, everything should work, provided all of the characters in your prefix variable are valid for use in these fields.



来源:https://stackoverflow.com/questions/15913308/invalidcharactererror-in-ie-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!