0

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);
1
  • Show us the jquery code building it, and the PHP code accessing the submission data. Commented Apr 10, 2013 at 14:55

1 Answer 1

3

Use select name keywordlist[] instead of keywordlist

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.