| View previous topic :: View next topic |
| Author |
Message |
sriharan Newbie

Joined: 27 Mar 2008 Posts: 12 :
Items
|
Posted: Mon May 26, 2008 9:33 am Post subject: readonly default value in dropdown list |
|
|
Hi
Applying a condition only to select a particular person from a table and show the results in a dropdown list works fine. The dropdown list contains only the name of that particular person nothing else after applying this condition. Butt he dropdown list shows “select” in the first place and the person’s name in the second place. A user must then click the dropdown list and then select his or her name even if there is only a single value in it. I wonder whether there is any other workaround to avoid this extra unnecessary clicking in this case.
How can this particular person’ name be shown as a default value in this dropdown list instead of showing ‘select’ or
Is it possible to hide the default ‘select’ in dropdown list? |
|
| Back to top |
|
 |
rima Junior

Joined: 16 Mar 2007 Posts: 27 :
Items
|
Posted: Wed Jul 09, 2008 9:54 pm Post subject: |
|
|
Hi,
-A quick solution is to put the result of your query in a variable $X and then set it as a default value : "default"=>$X
-In the datagrid.class.php =>function drawDropDownList the following line is responsible for showing the default 'select' in drop-down lists:
| Code: | | $text .= "<option>-- ".$this->lang['select']." --</option>"; |
Regards
Rima[/code] |
|
| Back to top |
|
 |
| |
|