hey everyone,
i'm working on a project that is used to create a web-based "survey" (a form) for later use.

the basic idea, is that a user (user = the person who is creating a form,) can add a dynamic number questions for the form, and for each question, the user gets a choice of if they want the question type to be a text box, radio button, or checkbox.

i was going to use javascript for this, but i don't know if i can do this type of thing (with the user able to dynamically adding more boxes when creating the form) with just javascript. should i do this type of thing just in php? maybe there isn't a way to do this dynamically changing form, used to create a form.

thanks

    Sure you can do it in JavaScript. It's just a matter of creating a well-formed function that'll add a node to the form each time this or that is clicked. Make the node a form object, give it the styles/values it needs, then have it named as something like...

    <input ... name='form[boxnum10]'...>
    

    Then you can dump off the form array into a text file or database somewhere, and use it however you like. Think this is what you were looking for.

      Write a Reply...