How do i use PHP/AJAX to update my form with new questions based on answers given to existing questions?

Question by Charles B: How do i use PHP/AJAX to update my form with new questions based on answers given to existing questions?
I am trying to write a form in PHP, my problem is here…when I ask if someone is over 18 and they answer yes, I want nothing to happen, but when they answer no, I want a new question to show up that asks if they have parental consent. I was told I could use AJAX to do this, but I cant for the life of me figure out how to do it.

Best answer:

Answer by Colanth
If they answer under 18, unhide the span with the parental consent question. You don’t need AJAX for that, just plain old-fashioned Javascript will do it..

Add your own answer in the comments!

No related content found.

Revisions

There are no revisions for this post.

Tags: , , , , , , ,

One Response to “How do i use PHP/AJAX to update my form with new questions based on answers given to existing questions?”

  1. Jim September 25, 2011 at 6:53 PM #

    something like:

    Yes:
    No:

    edit: having to put a few spaces in here so that it shows

Leave a Reply