Welcome Guest, Not a member yet? Register   Sign In
how to set width of CI dropdown and problem in selecting default value after page refresh
#1

[eluser]sheri.nust[/eluser]
Hey,

I am using CI form dropdown list, as
Code:
echo form_dropdown('brands', $arrayBrands,"0");

-->First problem is
how i can set width or other style properties for dropdown

-->second problem is i have following values in dropdown

Code:
<select name="brands">
<option selected="selected" value="0">select brand</option>
<option value="1">Exxiclo</option>
<option value="2">Levis</option>
</select

and i have made first selection using
Code:
echo form_dropdown('brands', $arrayBrands,"0");
Where "0" indicates default value

But if i refresh page using f5, default value doesn't selected.
However if i used ctrl + f5, the page is refresh and default value is selected.
I have attached snapshot of my page for above scenario.
#2

[eluser]Johan André[/eluser]
Do:

Code:
echo form_dropdown('brands', $arrayBrands, set_value('brands', 0), 'style="width:300px"');

Ofcourse you should not use inline style, use a css class to style instead...
#3

[eluser]sheri.nust[/eluser]
Thanx Johan.

the width problem has been solved,

But refresh problem is still there.

anyhow how much experience you have in CI?




Theme © iAndrew 2016 - Forum software by © MyBB