[FX.php List] Disable Fields?

David Ness dness at bondedbuilders.com
Thu Sep 3 06:42:48 MDT 2009


I believe that any solution is going to require some JavaScript, either
by enabling/disabling the radio button controls through JavaScript, or,
the approach I always take, hiding & showing the optional items as
needed: Enclose the digital 'add-ons' within a DIV. Make certain the DIV
has an ID assigned, and make certain that ID has a css (or inline) style
display = 'none'. This will make the default state 'hidden'.

Then use a bit of JavaScript to change the display attribute, something
like:

To Show:
document.getElementById( 'theDivsID' ).style.display = 'block';

To Hide:
document.getElementById( 'theDivsID' ).style.display = 'none';

You would put this code in a bit of JavaScript attached to the radio
buttons so that it's run whenever the value of "Cable" is changed.
'Basic', you hide it, 'Digital', you show the DIV.

I understand wanting to avoid JavaScript, but it become so ubiquitous,
and can enhance a web form or web application so greatly, it's worth
making the commitment.

Once you start using JavaScript to manipulate the page "DOM" (Document
Object Model), you'll be opening yourself up, and your work product, up
to such great new possibilities, you'll be very glad you did.

If you decide to start learning JavaScript DOM manipulations, also take
the time to learn some rudimentary CSS practices (if you haven't
already). CSS makes DOM manipulation even easier.

Hope this helps. Good luck.

 
David Allen Ness
Database Systems Administrator
Web Applications Developer
 
 
-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of VanBuskirk,
Patricia
Sent: Thursday, September 03, 2009 8:23 AM
To: FX.php Discussion List
Subject: [FX.php List] Disable Fields?

I have a student cable TV order form using FX.php feeding into a FMP9
database.

Option A. is a radio button named "Cable" with a value of "Basic";
Option B is a radio button also named "Cable" but with a value of
"Digital".  Under the Digital section (B), there are add-on options to
select (HDTV, DVR, etc) that are ONLY available to digital customers.

The issue that has come up is this:  A student is signing up for Basic,
then selecting digital add-ons.  Is there a simple way to disable the
add-on fields/options if "Basic" is chosen?  I'm pretty sure I could
find some java script to do it, but would rather stay away from java if
possible, since people can disable it.

Thanks,
Trish
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list


More information about the FX.php_List mailing list