I’ve got an issue :) And I’m trying to understand, why this issue occurs.. But i can’t figure out why it occurs. OK this is the problem, I’m using a form builder (in WP) called Visual Form Builder Pro and this plugin just works fine. But there seems not to be an option to allow the (website) user to duplicate a specific fieldset and get it validated.
OK this is what does work: The cloning of the fieldset (i know, it’s no beauty):
Adding an extra fieldset
// The variables
var link = '
Voeg nog een huisdier toe.
var fieldset = $('.uw-huisdier');
// Add the link to the fieldset
// Add a fieldset
// Copy the above fieldset and transfer it after the first on
var cloned = $(fieldset).clone();
// Make sure the link will die
Link to the website: link. And click on “Voeg nog een huisdier toe”.
So the cloning works but when you try to validate the form (by just clicking submit) you see that all the fields are validated (right or wrong), but not those which I’ve cloned. And I can’t figure out why. The validation seems to be done through jQuery… Someone please gimme a hand with this?
I’m not sure, but you are not supposed to have two or more items with the same id… If you do, when you’ll try to select these items by id via jQuery you’ll only get one of the (I think it is the first…) I think that what you need is change the id’s after the clone… e.g. $(cloned).attr(id,$(cloned).attr(id)+’2′)…