Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery ID selector not working for IE7 (.show()/.hide())
    primarykey
    data
    text
    <p>On jQuery load I'm trying to hide/show certain divs depending on condition. Everything works outside of IE7. I have broken it down and I have found that the following class selector <b>will</b> work:</p> <pre><code>$('.medication_div').hide(); </code></pre> <p>But, the ID selector, which I need, does not (Note: I tried harding code values which did also not work.</p> <pre><code>//Get the name of the medication selected var medication_selected = $("ul#medication_classes li:last-child p").text(); //Show the div associated with the selected medication card $("#"+medication_selected).show(); </code></pre> <p>Here is the HTML code generated after run:</p> <pre><code>&lt;ul id="medication_classes"&gt; &lt;li&gt; &lt;p&gt;Celexa&lt;/p&gt; &lt;input id="Meds_0" name="Meds[0]" type="hidden" value="Celexa" /&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt;Lisinopril&lt;/p&gt; &lt;input id="Meds_1" name="Meds[1]" type="hidden" value="Lisinopril" /&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div id="results_detail" class="grid_12 alpha"&gt; &lt;ul&gt; &lt;li&gt; &lt;div class="medication_div" id="Celexa"&gt; &lt;p id="class_trigger"&gt;Protocol Set Triggering: General&lt;input id="Celexa_ProtocolSetID" name="Celexa[ProtocolSetID]" type="hidden" value="1" /&gt;&lt;/p&gt;&lt;br&gt; &lt;p class="left_input"&gt;Does the patient still have active refills for Celexa?&lt;/p&gt; &lt;div class="right_input"&gt;No:&lt;input id="Celexa_ActiveRefills_No" name="Celexa[ActiveRefills]" type="radio" value="No" /&gt; Yes:&lt;input id="Celexa_ActiveRefills_Yes" name="Celexa[ActiveRefills]" type="radio" value="Yes" /&gt;&lt;/div&gt;&lt;br/&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;div id="Celexa_notActive"&gt; &lt;p&gt;Approve the Celexa refill as indicated in the patient record.&lt;/p&gt; &lt;/div&gt; &lt;div id="Celexa_active"&gt; &lt;p class="left_input" id="dose_change"&gt;When was the dosage for this medication last changed?&lt;/p&gt; &lt;div class="right_input"&gt;&lt;input class="date" id="Celexa_MedicationChangeDate" name="Celexa[MedicationChangeDate]" type="text" /&gt;&lt;/div&gt;&lt;br/&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;div class="table_header med_info"&gt; &lt;h5&gt;Fill in the following as much possible in order to find the most relevant protocol.&lt;/h5&gt; &lt;/div&gt; &lt;table width="846"&gt; &lt;tr id="labels"&gt; &lt;th width="33%"&gt;Name&lt;/th&gt; &lt;th width="33%"&gt;Value&lt;/th&gt; &lt;th width="33%"&gt;Result Date&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="33%"&gt;Medication Start&lt;input id="Celexa_TestResult_0_Name" name="Celexa[TestResult][0][Name]" type="hidden" value="Medication Start" /&gt; &lt;/td&gt; &lt;td width="33%"&gt; &lt;p&gt;N/A&lt;/p&gt; &lt;/td&gt; &lt;td width="33%"&gt; &lt;input class="date" id="Celexa_TestResult_0_Date" name="Celexa[TestResult][0][Date]" type="text" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;label&gt;Note to physician about refill request:&lt;/label&gt;&lt;textarea class="md_note" id="Celexa_Note" name="Celexa[Note]"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;div class="medication_div" id="Lisinopril"&gt; &lt;p id="class_trigger"&gt;Protocol Set Triggering: Hypertension Medications&lt;input id="Lisinopril_ProtocolSetID" name="Lisinopril[ProtocolSetID]" type="hidden" value="4" /&gt;&lt;/p&gt;&lt;br&gt; &lt;p class="left_input"&gt;Does the patient still have active refills for Lisinopril?&lt;/p&gt; &lt;div class="right_input"&gt;No:&lt;input id="Lisinopril_ActiveRefills_No" name="Lisinopril[ActiveRefills]" type="radio" value="No" /&gt; Yes:&lt;input id="Lisinopril_ActiveRefills_Yes" name="Lisinopril[ActiveRefills]" type="radio" value="Yes" /&gt;&lt;/div&gt;&lt;br/&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;div id="Lisinopril_notActive"&gt; &lt;p&gt;Approve the Lisinopril refill as indicated in the patient record.&lt;/p&gt; &lt;/div&gt; &lt;div id="Lisinopril_active"&gt; &lt;p class="left_input" id="dose_change"&gt;When was the dosage for this medication last changed?&lt;/p&gt; &lt;div class="right_input"&gt;&lt;input class="date" id="Lisinopril_MedicationChangeDate" name="Lisinopril[MedicationChangeDate]" type="text" /&gt;&lt;/div&gt;&lt;br/&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;div class="table_header med_info"&gt; &lt;h5&gt;Fill in the following as much possible in order to find the most relevant protocol.&lt;/h5&gt; &lt;/div&gt; &lt;table width="846"&gt; &lt;tr id="labels"&gt; &lt;th width="33%"&gt;Name&lt;/th&gt; &lt;th width="33%"&gt;Value&lt;/th&gt; &lt;th width="33%"&gt;Result Date&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="33%"&gt;Medication Start&lt;input id="Lisinopril_TestResult_0_Name" name="Lisinopril[TestResult][0][Name]" type="hidden" value="Medication Start" /&gt; &lt;/td&gt; &lt;td width="33%"&gt; &lt;p&gt;N/A&lt;/p&gt; &lt;/td&gt; &lt;td width="33%"&gt; &lt;input class="date" id="Lisinopril_TestResult_0_Date" name="Lisinopril[TestResult][0][Date]" type="text" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td width="33%"&gt;Creatinine&lt;input id="Lisinopril_TestResult_1_Name" name="Lisinopril[TestResult][1][Name]" type="hidden" value="Creatinine" /&gt; &lt;/td&gt; &lt;td width="33%"&gt; &lt;input id="Lisinopril_TestResult_1_Value" name="Lisinopril[TestResult][1][Value]" type="text" /&gt; &lt;/td&gt; &lt;td width="33%"&gt; &lt;input class="date" id="Lisinopril_TestResult_1_Date" name="Lisinopril[TestResult][1][Date]" type="text" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;label&gt;Note to physician about refill request:&lt;/label&gt;&lt;textarea class="md_note" id="Lisinopril_Note" name="Lisinopril[Note]"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>When hard-coding for the above example I have hard-coded to no avail:</p> <pre><code>$("#Celexa").show(); </code></pre> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    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