I want to allow users to add textbox element using javascript by clicking the add button.
I would like to know how I can use Zend validate to validate those elements that are created by javascript.
I want to allow users to add textbox element using javascript by clicking the add button.
I would like to know how I can use Zend validate to validate those elements that are created by javascript.
addPrefix to the new added and then check for prefixed keys in $_POST and add the fields to the form. There is no easy way to do this.
There is no built in way for that but it shouldn't be too tricky to do this.
Firstly, I would suggest naming your JavaScript-generated elements with array notation, ie. name='someName[]'
, so that PHP parses them into an array in POST/GET.
Then, you can simply loop over the resulting array, and call your validator(s)/validator chain.