in reply to Re^2: Equivalent functionality in CGI.pm
in thread Equivalent functionality in CGI.pm

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)' ),

Mike Schienle

Replies are listed 'Best First'.
Re^4: Equivalent functionality in CGI.pm
by Your Mother (Archbishop) on Jul 04, 2004 at 20:42 UTC

    Yeah, sorry, I missed the different IDs. Two calls is fine. You could also change the JS to operate off a "this" instead of an "event" and get down to one CGI call. The JS functions would have to do different checking of state and such though.

      I think I'll save the JS changes for another day. I'm knee deep into Spreadsheet::WriteExcel at the moment. I don't think I can handle another context switch for a while.

      Thanks for the pointers.
      Mike Schienle