The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Dependent fields - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Dependent fields (/showthread.php?tid=85) |
Dependent fields - nomad - Mar 26th, 2009 Sorry for newbie question. System looks great, but before I will install it, I would like to confirm important feature I could not find in help or demo. I prefer easy forms, so I usually hide all fields which are not necessary. It is posible to use an dependent fields, which are visible only if previous (parent) field is selected (checkbox) or certain value is selected (pop-up menu)? Example: Parent checkbox: Do you smoke? If selected, next dependent fields will appear: - Which is you favorite branch? - How many cigarettes do you smoke a day? - ..... Thanks for your help. RE: Dependent fields - typer139 - Mar 26th, 2009 Hey Nomad, I'm not sure how this could be incorporated into the Formtools system itself, but I typically just handled it all through JavaScript. I've got a pretty intricate form that has tons of dependencies.. Here's some code I use on one field, i believe it's a dropdown but could be anything with a value. I typically fire this JavaScript "onChange" or "onClick" of the parent field. I put DIV tags around field areas that will be shown/hidden and change their visibility based on the "parent" selection. In this code I also disable the box because I have a validation script that runs through all the fields on submit and it doesn't validate the "disabled" one's. (I found this out the hard was when the form never got submitted because all these "hidden" fields were still being validated and not passing) Hope it works for you.. Rich Morgan Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> RE: Dependent fields - nomad - Mar 26th, 2009 Dear Typer, thanks for your replay. I use Javascript in similar way for unhidding child fields or making form more comfortable (moving to first incorrect filled field, validation or so). I was just wonder if the system can do that automatically as I noticed that demo uses Java scripts for validation (but it works in pure php if Java is disabled). (Mar 26th, 2009, 8:42 AM)typer139 Wrote: Hey Nomad, RE: Dependent fields - Ben - Mar 26th, 2009 Hey guys, Nomad - no, unfortunately the system doesn't include any JS for that. You'll need to take Typer's suggestion for hiding/showing the fields. If you're using jQuery, Prototype or other JS framework, they all contain simple ways to do this too. All the best! - Ben RE: Dependent fields - nomad - Mar 30th, 2009 Dear all, sorry for my original question from 26th, I installed and test Form tools in the meantime and this is a Form processor NOT Form bilder (I saw many different tools in one day and I was little chaotic). My question had no sense then. Regards, Pavel RE: Dependent fields - ElbertJulr - Aug 27th, 2014 (Mar 26th, 2009, 7:55 AM)nomad Wrote: Sorry for newbie question. System looks great, but before I will install it, I would like to confirm important feature I could not find in help or demo.Hello friend bit old thread. I am new to coding and I do need to make similar program so can you help me with some code help? I will explain you when you get in contact.. |