danarj
danarj

Reputation: 1838

html listbox and submit to php page

I create a list like this

<select multiple="multiple" style="width: 120px;" id="list" name="keywordlist" size="0">                
</select>

and I add item to this by jquery and every thing work ok until I submit it to the server(PHP) the post variable contain only the last <option></option> I clicked on I want to get all the list from the server side.

this the jquery:

 $("#list").append("<option value='"+$("#keyword").val()+"' selected='true'>"+$("#keyword").val()+"</option>");
                var i= $("#list").attr("size");
                i=parseInt(i);
                i++;
                $("#list").attr("size",i);

Upvotes: 0

Views: 376

Answers (1)

CoolEsh
CoolEsh

Reputation: 3154

Use select name keywordlist[] instead of keywordlist

Upvotes: 3

Related Questions