0

I am trying to make a form where a user can insert his curriculum vitae data. At the moment i have created an experience form type containing all the experience related fields. The problem is that the user has to be able to add or remove as many experiences as he likes clicking add or minus buttons. I can accomplish this with javascript, but it doesn't seem to be the best solution. Is there a way of accomplishing this with symfony2? Maybe with some kind of event listener that creates or removes a form type?

2 Answers 2

2

It should be done with JavaScript, as a server side script language (php) can't run without refreshing the page.

On how to do this with Symfony, see: http://symfony.com/doc/current/cookbook/form/form_collections.html

Sign up to request clarification or add additional context in comments.

Comments

1

An own experience form type is good. Then you need to implement this form type as a collection in your parent form. For adding/removing an experience in the rendered output javascript/jQuery is still needed. But only for adding the <form> prototype.

Take a look at this exciting cookbook article about collection in forms

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.