Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

i try to use Tag-it jquery plugin. it convert entry tag to:

<input type="hidden" style="display:none;" value="tag1" name="item[tags][]">
<input type="hidden" style="display:none;" value="tag2" name="item[tags][]">

when form submit, it will send to another page, the problem is that i want use "item[tags][]" in loop but using foreach just give me error for invalid arguments. can any one help me with this loop. thanks

share|improve this question

1 Answer 1

HTML

<input type="hidden" style="display:none;" value="tag1,tag2" name="tags">

jQuery:

 $('input[name="tags"]').tagit();

You will see these two tags: tag1 and tag2 and if you submit it you will get the tags separated by a comma in for example php in $_GET["tags"]

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.