The radio_group code you provided is pretty close to what I started out with, I just couldn't get it to work with the JavaScript. And I couldn't get CGI to spit out a single radio_group using both the hideEmail and showEmail ID's. I think my real problem is sticking with CGI beyond it's usefulness. I've been checking out templating systems for a couple months, but I'm adding to an application that's been around for a lot longer. Any new development will likely be using TT.
What I've done in the last few minutes is this, which works correctly, but it just seems wrong to make two calls to radio_group, each with one button. That's due to the JavaScript needing two different id's as currenly written.
'Show Email:',
$q->radio_group(
-id => 'hideEmail',
-name => 'radioEmail',
-values => 'No',
-default => 'No',
-onclick => 'toggleEmail(event)'
),
$q->radio_group(
-id => 'showEmail',
-name => 'radioEmail',
-values => 'Yes',
-default => 'No',
-onclick => 'toggleEmail(event)'
),
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.