Note that there are some explanatory texts on larger screens.

plurals
  1. POIE8 stripping ID attributes, huh?
    primarykey
    data
    text
    <p>When using jQuery to insert HTML into a div in IE8, IE8 strips the ID tags and certain class names in the HTML.</p> <p>Here is a sample. I am inserting this code using jQuery (1.6.2)</p> <pre><code>var oblSomeoneElseHTML = '&lt;div id="oblSomeoneElse"&gt;' + ' &lt;h2&gt;Enter the name and email of a person you\'d like&lt;br/&gt;to purchase a registration for:&lt;/h2&gt;'+ '&lt;form class="voucher_form" id="voucher_form"&gt;'+ ' &lt;div class="inputrow"&gt;&lt;label class="l1"&gt;Student Alliance Member #:&lt;/label&gt; &lt;input type="text" id="customer_id" name="customer_id" class="oblSomeoneElseCustID"/&gt;&lt;/div&gt;&lt;br&gt;'+ ' &lt;div class="inputrow"&gt;&lt;label class="l1"&gt;Student First Name:&lt;em&gt;*&lt;/em&gt;&lt;/label&gt; &lt;input type="text" id="firstname" name="firstname" class="validate[required] oblSomeoneElseFirstName"/&gt;&lt;/div&gt;&lt;br&gt;'+ ' &lt;div class="inputrow"&gt;&lt;label class="l1"&gt;Student Last Name:&lt;em&gt;*&lt;/em&gt;&lt;/label&gt; &lt;input type="text" id="lastname" name="lastname" class="validate[required] oblSomeoneElseLastName"/&gt;&lt;/div&gt;&lt;br&gt;'+ ' &lt;div class="inputrow"&gt;&lt;label class="l1"&gt;Student Date of Birth:&lt;em&gt;*&lt;/em&gt;&lt;/label&gt; &lt;input type="text" id="DOB" name="DOB" class="validate[required,custom[MMDDYYYY]] oblSomeoneElseDOB"/&gt;&lt;/div&gt;&lt;br&gt;'+ ' &lt;div class="inputrow"&gt;&lt;label class="l1"&gt;Student Email:&lt;em&gt;*&lt;/em&gt;&lt;/label&gt; &lt;input type="text" id="SomeoneElseEmail" name="SomeoneElseEmail" class="validate[required,custom[email] oblSomeoneElseEmail"/&gt;&lt;/div&gt;&lt;br&gt;'+ ' &lt;a href="#" class="btn btncenter oblsomeoneelsenext"&gt;Next&lt;/a&gt;'+ ' &lt;div class="spinner"&gt;&lt;img src="/images/grey_spinner.gif"&gt;&lt;/div&gt;'+ '&lt;/form&gt;'+ '&lt;img src="/images/blank.gif" width="20" height="20" alt="" border="0" style="position: relative; left: 5px; cursor: pointer;" onclick="clearPrompts();"&gt;'+ '&lt;/div&gt;'; $('#sm_content .oblcontent').html(oblSomeoneElseHTML); </code></pre> <p>Now, when I am debugging the validation of the DOB input and view the value of oblSomeoneElseHTML in the Watch window, it shows the ID and the correct class attributes. I am using validationEngine plugin to validate this form and it REQUIRES the ID tag to work. </p> <pre><code>&lt;input type="text" id="DOB" name="DOB" class="validate[required,custom[MMDDYYYY]] oblSomeoneElseDOB"/&gt;&lt;/div&gt; </code></pre> <p>But, when I debug into the validationEngine code, this, in the _getPrompt() function:</p> <pre><code> var className = field.attr("id").replace(":","_") + "formError"; </code></pre> <p>returns this error: </p> <pre><code>'attr(...)' is null or not an object </code></pre> <p>When I evaluate the field object, I see no id value and I see only class oblSomeoneElseDOB.</p> <p>I am at a loss as to what is happening here and why this is only happening in IE8. IE7 and IE9 work perfectly, FF and Chrome and Opera work perfectly, too.</p> <p>Anyone have any ideas on how to fix this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload