tags:

views:

52

answers:

4

My code is retrieving player names from a database and outputting them into a combo box. However I want the first entry of the combo box to be empty, how can I achieve this?

If it helps, here is my code. Please note I only have 1 option box code in HTML as I'm editing phpBB. The <-- BEGIN clubplayer --> is a loop.

alt text

alt text

+2  A: 

After

<select name="id" id="id">

Add

<option></option>
Mike Sherov
Thank you very much!
Jonny
+1  A: 

How about putting a empty

<options value=""></option>

Before <!-- BEGIN.....

Iznogood
Thank you very much!
Jonny
+1  A: 

Set the first option in your select like this:

<option value="">--select--</option>
kingjeffrey
Thank you very much!
Jonny
+1  A: 

I'd go for the same solution as others, but there's always a different solution available... Before your while loop, you can:

$template->assign_block_vars('clubplayer', array(
    'PLAYERS' => '' #assign empty value
));
Tom