How to give default value like ----select id----- in this drop down..?

<?php $id = 'id="memberId"'; echo form_dropdown('member_id', $member_id, set_value('member_id'), $id);?>

you would have to check the documentation for form_dropdown() for that.

Already i am getting member id based on that username also but it is working like onclick based, so here how to give Default selection in this dropdown…?

ask the one who wrote that function.

The proper term for what you are calling “default value” is “selected”

<!-- The second value will be selected initially -->
<select name="select">
  <option value="value1">Value 1</option> 
  <option value="value2" selected>Value 2</option>
  <option value="value3">Value 3</option>
</select>

Are you using CodeIgniter here? That looks like the syntax from the form helper. If that’s the case, the third parameter is the default value.

maybe you are just mistaking “default” with “dummy” value? so you only need to array_unshift($member_id, 'foobar');

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.