Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Could someone explain me with a little example how create a button that creates a new custom field dynamically?

I'm working on a plugin and using add_meta_box, I need an input box (administration-side) and a button that when clicked will create a new input box, after saving the previous data (on a custom database).

share|improve this question
    
Are you looking for something like this - web-design-talk.co.uk/examples/2/1 You want to add many values under one custom field just like that example ? –  amit Jul 11 '12 at 15:29
    
yes! Exactly! Could you help me with a simple example of this in case of a form in a post-new.php ? How do this with a plugin ? –  Francesco Jul 13 '12 at 9:04
add comment

1 Answer

You are looking for Repeatable Fields.

Here in WPSE, it was covered in the following Q&A:
Custom Meta Boxes: Store two values in one repeatable field

A Gist:
https://gist.github.com/2057532

Class helpers for building the plugin options page:

share|improve this answer
add comment

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.