Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    You do this with javascript or jQuery. When the user clicks on add field the extra HTML is added to the form. When remove field is clicked, the related HTML is removed. Keep the IDs coordinated to facilitate this. This is all done client side, the server is not involved.

    When the form is submitted, the PHP needs to be able to process an indefinite number of fields. I haven’t done this in a while, but I believe if you give the fields the same name, including ‘[]’ ( <input name="country[]" ... ) all the values end up in an array in PHP and you can simply foreach step through the values. Or something like that anyway.

    I hope this helps.

    hi how to add the widgets in the sidebar at anyother page..

    Moderator bcworkz

    (@bcworkz)

    GlapsGokul – if the sidebar has been registered, just add the widget to it on the widgets admin screen. The sidebar then displays widgets added with dynamic_sidebar().

    FYI, we ask that people not tag on to other’s topics in these forums, this policy allows members to better focus on the OP’s specific issue. By starting your own topic, you will get everyone’s undivided attention. If you have any other questions, go ahead and start a new topic.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Adding repeatable fields used in Widgets – sidebar?’ is closed to new replies.