Hello, I want to create a form programmatically after a user is registered through the registration form.
I have achieved duplication but the conditionals and fields keep the old field values from the form i duplicated instead of updating the interconnections between the fields. This is my code:
Shouldn't be a bug but thanks for the idea. There is surely a way to duplicate options, I just thought that the duplicate method handles all that.
I'm not sure what you mean by "shouldn't be a bug". At the very least it should be a feature request, though it seems to me like an oversight. It's a fair expectation that the form duplication process should duplicate the form's fields as thoroughly as possible and part of that is duplicating the conditional logic. If you mean there should be a way to do it yourself; grab the old field options, figure out the new field IDs that should be substituted in there, and write out the new field options.
What i meant is i want to do it with code myself, the Duplicate Form works fine on it's own. However i have found what the problem is, the hooks aren't all being loaded and that's why it wasn't working.
Actually from the backend when i try to register a user it works, the hooks just aren't loaded on the frontend when i submit the form, otherwise it's fine.
Please login or Register to submit your answer