Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery hide and show method not working
    primarykey
    data
    text
    <p>Note : I use <code>codeigniter</code> framework</p> <p>EDIT : I dont know its related or not, but the element that i want to shown (<code>form_range_kelas</code>) is a <code>p</code></p> <p>I have a <code>dropdown</code> that will control other html element's visibility. I only have a little experience with <code>jquery/javascript</code> so i search on this site and i got this <a href="http://jsfiddle.net/8Ct5r/" rel="nofollow">fiddle</a></p> <p>So, i followed that fiddle, but its not working..its just not working, i tried to see firebug but it seems like nothing happened.</p> <p>This is the <code>dropdown</code> code (<strong>Using</strong> <code>codeigniter's</code> <strong>library</strong>):</p> <pre><code> &lt;p&gt; Search By : &lt;?php echo form_dropdown('ddl_search', $data_search, 'id="ddl_search"');?&gt; &lt;/p&gt; </code></pre> <p>This is my script(from <strong>jquery ui</strong>, <strong>its included jquery right?</strong>):</p> <pre><code>&lt;script language="javascript" type="text/javascript" src="&lt;?php echo base_url(); ?&gt;jquery/jquery-ui-1.10.2.custom/js/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script language="javascript" type="text/javascript" src="&lt;?php echo base_url(); ?&gt;jquery/jquery-ui-1.10.2.custom/js/jquery-ui-1.10.2.custom.min.js"&gt;&lt;/script&gt; </code></pre> <p>This is my <code>html</code> element which i want to change it's visibility :</p> <pre><code> &lt;p id="form_range_kelas"&gt; Kelas : &lt;?php echo form_dropdown('ddl_kelas1', $list_kelas, 'id="ddl_kelas1"');?&gt; - &lt;?php echo form_dropdown('ddl_kelas2', $list_kelas, 'id="ddl_kelas2"');?&gt; &lt;/p&gt; </code></pre> <p>This is my <strong>FULL</strong> <code>javascript/jquery</code> code (<strong>NOTE : The alert is NOT working</strong>):</p> <pre><code> &lt;script&gt; $(function() { $( "#datepicker" ).datepicker(); }); $('#ddl_search').change(function() { alert("a"); if ($(this).val() == 'range_kelas') $('#form_range_kelas').show(); else $('#form_range_kelas').hide(); }); &lt;/script&gt; </code></pre> <p>And this is the data in my <code>controller</code>(<strong>codeigniter</strong>) :</p> <pre><code>$data['data_search'] = array('kelas' =&gt; 'Kelas', 'range_kelas' =&gt; 'Range Kelas', 'nama' =&gt; 'Nama', 'alamat' =&gt; 'Alamat', 'bulan' =&gt; 'Bulan Lahir', 'range_bulan' =&gt; 'Range Bulan Lahir'); </code></pre> <p>What should i do?</p> <p>Thanks :D</p>
    singulars
    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.
 

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