in reply to Re: Is there a way to set a textfield -name value at runtime?
in thread Is there a way to set a textfield -name value at runtime?
Thanks Eric...I have updated my posting with a standalone test case of what I'm trying to do. The two blocks of code in the main posting relate to each other like this:
- The %options hash has a set of cgi objects (i.e. checkboxes, textfields, radio buttons) that I want to be able to select from as sub-options for a given top-level radio button.
- Each key of %report_types points to a hashref that defines the properties of that particular report: its name (name), its sub-options (opts), and its generator (coderef).
Since there are two reports defined, each of which has a "date" textfield as a sub-option, I'd like to name these textfields according to the report type (i.e. "date_1" and "date_2"). But since the "date" textfield is defined once in the %options hash, I don't see how to do this.
Update: I just realized that I can probably do what I want by making my own Reports class, creating instances at runtime with the necessary sub-options. The names of the textfields can then be assigned unique values by passing in an appropriate parameter during the instance construction.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Is there a way to set a textfield -name value at runtime?
by eric256 (Parson) on Jan 26, 2008 at 04:47 UTC |