I have a PHP array which is populated from a MySQL database, in this case it's a list of countries - the countries ISO numeric identifier and the name.
The PHP Array populates fine and it outputs into a select list (using the Zebra Form PHP/JQuery class: Zebra_Form, a jQuery augmented PHP library for creating and validating HTML forms) and this is where the issue starts:
The select list populates with the isonum's and countries as expected, however also displays the array numeric identifier at the top (which looks bad and also breaks the ability to type search the options):
I did an array_splice($dataArray,0) which hides the 0 but caused a knock on issue - the select field was populated with options but countries ended up with rewritten key values so no longer were $_POST'ing their correct isonum's. Can anyone point me in the direction of a method to hide the 0 and maintain the correct isonum values for each country?Quote: