开发者

How to hide the listbox in php code igniter?

开发者 https://www.devze.com 2023-03-24 17:48 出处:网络
$options = array( \'small\'=> \'Small Shirt\', \'开发者_StackOverflow中文版med\'=> \'Medium Shirt\',
$options = array(
              'small'  => 'Small Shirt',
              '开发者_StackOverflow中文版med'    => 'Medium Shirt',
              'large'   => 'Large Shirt',
              'xlarge' => 'Extra Large Shirt',
            );    echo form_dropdown('some_name', $options, '  ' ,'id='some_id');

Now i want to hide this listbox .. How do i do this??


Hide? you mean with javascript? You're not very clear in your question, so if I misunderstood just let know

  $options = array(........);
  echo form_dropdown('some_name',$options,'','id="some_id"');

Hiding:

Using jQuery:

$(document).ready(function(){
    $('#some_id').hide('fast');
});

Or with CSS:

#some_id { display:none; }  /* this will also free up the space used by the dropdown*/
#some_id { visibility:hidden; } /* this just makes it invisible, but the space it occupies its preserved*/

Note that as forth parameter to the form_dropdown() you pass a string, so you could give it an id, a class, an onlick event, whatever. So, you can give it a 'class="invisible" id="some_id" onclick="myfunction"' and manage it's visibility with that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号