Link to home
Start Free TrialLog in
Avatar of centerforward
centerforward

asked on

Create a form that builds itself dynamically as the visitor proceeds (direct me to a good tutorial?) ...

What I want to do is present the visitor with the beginning of a magazine order form with a simple radio button question like, "Would you like to order a print issue, or a digital issue?"

If they choose print, then the page displays the rest of the form options and prices that relate to ordering print issues of the publication.

But if they choose digital, then the page displays the rest of the form options and prices that relate to ordering a digital issue.

The next correlating section of the form should just appear beneath the original first simple radio-button question, without the page refreshing, or the user submitting the form, etc.

Each form section has totally different fields, depending on what the visitor originally chose (print or digital), and what I'm trying to do is streamline the process rather than having a single convoluted form with too many options, half of which the visitor doesn't need.  I also want to avoid a multiple-page or multiple-step form process, since there aren't that many choices really, once I have some initial info.  And I don't want to start the whole process with separate links (for print or digital), I realize that'd be one way to do it, but I'll likely have additional form questions that should change next available form fields...

I'm comfortable building php forms with simple javascript validation that submit at the end to a mysql database.  But I'm old-school, and using some "old" techniques, and a total newbie to anything like ajax, jquery, drupal, etc.

All I wanted to do today was find a good tutorial where I can start learning jquery and ajax or drupal? and so forth, but I'd feel better if I knew what direction is best to go in (as far as self-teaching) in terms of what technology is best and most current for best accomplishing this.

I couldn't find a good tutorial because I can't figure out what to search on to research this specific goal because the search keywords are too generic ("dynamic" "form" "building" "changing" etc.).

I found a lot of interesting stuff.  But I specifically would like to accomplish a form that builds itself as the visitor makes initial choices, depending on what the visitor chooses (without any page refresh or submit or continuing to a second page).  I don't know what to call this, but surely I'm not the first to look for it!  

If anyone with experience with this can guide me towards a good tutorial to learn how to do it, or explain the components I need to learn, etc., that'd be awesome!!

Thanks so much in advance for your time and help,
Alan
SOLUTION
Avatar of junipllc
junipllc
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I agree with Mike on the jQuery point, it does ROCK !

Using simple divs for the form sections and jQuery to hide/show the divs as required would do what you need.

Drupal, may be using a sledgehammer to crack a nut in my opinion, however, please have a look and you may find it does what you need...
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Haha, @maeltar. You're probably right, but since Alan mentioned learning Drupal, jQuery, AJAX (and AHAH, hopefully) I figured I'd shoot over the "big shebang."

@Alan: just a warning: should you decide to start with Drupal, you will be addicted in short order. Either that or frustrated to no end ;)

Cheers,

Mike
Avatar of centerforward
centerforward

ASKER

Wow you guys are the best! --  
EXACTLY what I needed.  

I handcoded custom .php CMS systems for years before any of this stuff was out there, and I know I need to "evolve" to Drupal or Wordpress or something, and I've just stalled because it's nice to already know something inside and out...  

BUT anyway, Mike thanks much for the encouragement I'm SURE you're right, and Maeltar(Simon?) that code example is perfectly clean and minimal and just what I needed - I think I'll start with that just to familiarize/learn as simply as possible, and then get into Drupal soon hopefully.. and just to confirm, you're example ONLY uses CSS div's and jquery right (no drupal) ...  looks perfect!

Thanks again so much ya'll, haven't used EE in a long time but it sure did just come through for me!  Thanks, A
You are welcome, thank you for the points, and yes just uses divs..