Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
First of all, I'd like to thank everyone for their help on this topic - I think I came out of it with exactly what I was looking for. Using a solution presented by Sifmole, I was able to use HTML::Template to separate my Perl script from my HTML and make a (I believe) much more maintainable script. This is what I ended up with:
# editForm.tmpl - The template file I'm now using <HTML> <HEAD> <TITLE>Administrative Schedule Editor</TITLE> </HEAD> <BODY> <FORM method="post" ACTION="http://www.mediaforgeproductions.com/cgi-b +in/SchedBuilder/login.pl"> <TABLE BORDER="1"> <TR> <TD VALIGN="top"> <TABLE BORDER="1"> <TR> <TD><CENTER>Days with Appointments</CENTER></TD> </TR> <TR> <TD> <CENTER> <SELECT NAME="daysList" SIZE="5"> <TMPL_LOOP NAME="daysList"> <OPTION VALUE="<TMPL_VAR NAME="daysListValue">"><TMPL_VA +R NAME="daysListValueText"> </TMPL_LOOP> </SELECT> </CENTER> </TD> </TR> <TR> <TD> <CENTER><INPUT TYPE="SUBMIT" VALUE="Display Appts"></CENTE +R> </TD> </TR> </TABLE> </TD> <TD VALIGN="top"> <TABLE BORDER="1"> <TR> <TD><CENTER>Appointments:</CENTER></TD> </TR> <TR> <TD> <CENTER> <SELECT NAME="apptsList" SIZE="5"> <TMPL_LOOP NAME="apptsList"> <OPTION VALUE="<TMPL_VAR NAME="apptsListValue">"><TMPL +_VAR NAME="apptsListValueText"> </TMPL_LOOP> </SELECT> </CENTER> </TD> </TR> </TABLE> </TD> </TR> </TABLE> </FORM> </BODY> </HTML> # Perl file # # For brevity, I've only included the code # to fill one of the two select boxes. my $template = HTML::Template->new(filename => 'editForm.tmpl'); my @dateList; foreach my $element (keys %calendar) { push @dateList, {'daysListValue' => $element, 'daysListValueText' => + $element}; } $template->param( daysList => \@dateList, apptsList => \@apptTimeList ); print $template->output;
I'm sorry that this post has been so long, but I felt that this code could be useful to anyone that might run into a similar issue in the future. Again, thanks for all your help.

- Sherlock

Skepticism is the source of knowledge as much as knowledge is the source of skepticism.

In reply to Re: Interactive Form Creation/Maintenance by Sherlock
in thread Interactive Form Creation/Maintenance by Sherlock

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-25 20:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found