I’m using DOMdocument to create forms.
To add more input box in the fieldset, I use this:
$fieldset->appendChild ( $textinput->cloneNode());
I would like to learn how to change the id and name of the cloned input box. for example, the first input box is id = “box”, name=”box-input”, then, in the clone, I want it be id=”box-2″, name = “box-input-2”. Can this be done?
Clone it first, change the attributes and append it: