JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 19th, 2005, 12:21 PM
jamike jamike is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 3 jamike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 5 sec
Reputation Power: 0
Question Form design: unknown number of date fields in form?

I've searched the forum for something similar to this, but it's tough to really describe my problem in a less than verbose way, so I'm gonna post my problem and hopefully some of the big brains around here have some ideas...

I'm designing a medical form for a client and have a few questions on the form that are yes/no answers, basic radio button style. My problem lies in when a user chooses yes, because then I need to collect a series of dates from them (medical history type info), and there could be 1 date, there could be 20. For example, if the question is "recent x-rays?" yes or no, and they choose yes, I need to collect the dates of the recent x-ray(s), and there could be 1 x-ray they've had recently, or 20 over the course of a few years.

I've thought about putting a little iframe next to the yes/no piece, with a list of date fields that users could fill in, but my problem with that lies in how to submit the iframe data with the rest of the form which is of course not in the iframe. Of course, I'm open to ANY ideas or methods anyone has, I'm definitely not locked into the iframe idea at all.

Any thoughts? The users of this form will be a controlled group, so I CAN put restrictions on browser use, for example locking them into IE6 with JavaScript turned on, etc.

Thanks in advance!

Mike

Reply With Quote
  #2  
Old September 19th, 2005, 01:44 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,817 jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 7 h 14 m 56 sec
Reputation Power: 1098
You can do this client-side with JavaScript, or server side with any server-side language. If you can guarantee the availability of JavaScript, that's my recommendation b/c it will be quicker and more user friendly. But the choice is really yours.
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #3  
Old September 19th, 2005, 01:50 PM
jamike jamike is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 3 jamike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 5 sec
Reputation Power: 0
Thanks for the reply jharnois. Can you give me a little detail as to how you'd do it? If I use an iframe, ideally I'd like the whole form, including the iframes, to submit into a single post that I can handle with PHP, so I know which dates are associated with which yes/no questions.

Thanks.

Reply With Quote
  #4  
Old September 19th, 2005, 02:29 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,817 jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 7 h 14 m 56 sec
Reputation Power: 1098
You'd be using DHTML (Dyanmic HTML), which is a combination of CSS properties and JavaScript to modify those properties. Additionally, you'd probably end up using the innerHTML property, which will allow you to dynamically add form field inputs.

Moving this post to the JavaScript forum since that's where it's heading. I'll come up with an example at some point, but until then, search Google for those keywords in the previous paragraph.

Drop the iframe idea altogether.

Reply With Quote
  #5  
Old September 19th, 2005, 03:31 PM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,831 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 1 Day 19 h 19 m 2 sec
Reputation Power: 4192
Modifying forms with innerHTML doesn't work very well. It's better to use DOM1+ methods.
__________________
Spreading knowledge, one newbie at a time. I'm available for hire at Dynamic Site Solutions.

Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

Remember people spend most of their time on other people's sites (so don't violate web design conventions).

Reply With Quote
  #6  
Old September 19th, 2005, 03:44 PM
jamike jamike is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 3 jamike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 5 sec
Reputation Power: 0
Fantastic, thanks for the helpful replies guys. Based on both your suggestions, I've done some research and found this page:

http://www.quirksmode.org/dom/usableforms.html

It looks like it'll handle exactly what I need. In my case, when the user chooses yes on the question, I can "open" the section with the date fields and let them fill those in then.

Thanks a bunch for your help! Any further insight is still appreciated, as I haven't implemented this yet and it still may not work.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Form design: unknown number of date fields in form?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap