Old 31-10-2006, 18:42   #1 (permalink)
mtran
Nooneknow
 
mtran's Avatar
 
Join Date: Nov 2004
Location: CA, USA
Posts: 38
Form question

Hi,

I'm working on a form and wondering if there's a script that can do the following.
I have: Q1: radio inputs with 2 options : Yes and No
If somebody clicks Yes, then they go to Q2: fill in some input text fields.
If they click No, they'll skip Q2 and go to Q3.

My question is: can we do something with javascript & CSS so that when they click No in Q1, Q2 with input text fields become unfillable, hidden, or at least change colors...

Thanks for help.
  Reply With Quote
Old 31-10-2006, 21:07   #2 (permalink)
datahound
Spare Parts
 
datahound's Avatar
 
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 4,717
I would do it with PHP.

Would have q1.php, q2.php, q3.php.

I would include q1.php in, for example, quiz.php.

Then returning the form results to quiz.php

if $q1answer == A include q2.php

elseif $q1answer == B include q3.php

etc.
__________________
  Reply With Quote
Old 01-11-2006, 09:36   #3 (permalink)
combat sheep
Trained to Kill.
 
combat sheep's Avatar
 
Join Date: Oct 2006
Location: Southport, UK
Posts: 308
Send a message via MSN to combat sheep
are the input fields on their own or separate pages ?

if all on the same just use the javascript select function (similar to tabbing)

if on separate pages, uses datahound's example but personally I'd use the ternary operator
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8