Radio Button Options


You can also change the default drop-down option boxes to radio buttons (see Figure 7.5). The radio button input element does the same thing as the drop-down list: It enables the user to select one of a number of choices. To do this, again modify the Order. template. Locate the following block in the Order. template:

else MULTI        TEXT ELEMENT position 0                      sequence set        TEXT ": "        SELECT name ELEMENT position 0                              sequence set                options ELEMENTS sequence set                                  first 1 


Replace the entire block starting with MULTI with the following:

CALL :radio-options   set 


Because you do not have the radio-options template, you will need to create it as follows:

Radio-options (set) WITH= variable name       value ELEMENT position 0                      sequence set   TEXT name   TEXT ":"   LINEBREAK   FOR-EACH variable option            sequence ELEMENTS sequence set                                first 1      INPUT name name            type :radio            value option      TEXT option      LINEBREAK 


These modifications to the Order.template change all the drop-down options to radio buttons. If you want the option to selectively change the options to radio buttons, you can modify the Order. template, based on how we did it for the check boxes, to indicate whether you want radio buttons or standard drop-downs. (We leave the details of this change to you as an exercise.)

One additional note: For this to work, you might have to go to Order Form in the Store Manager, scroll down to the bottom, and change the Item Option Validation setting to allow items with unrecognized options. But try it first: If your radio buttons work without that setting, you won't need to change it.

Figure 7.6. Radio button options.





Succeeding At Your Yahoo! Business
Succeeding At Your Yahoo! Business
ISBN: 0789735342
EAN: 2147483647
Year: N/A
Pages: 208

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net