Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Thanks, punkish!

I did a dump of @options.

# This dumped output of options is #$VAR1 = { 'school' => 'Admiralty Primary', 'school_id' => '1' }; #$VAR2 = { 'school' => 'Ahmad Ibrahim Primary', 'school_id' => '2' }; #$VAR3 = { 'school' => 'Anderson Primary', 'school_id' => '3' }; # the relevant template is # note that the school_id in <select name="school_id"> is # hard-coded whereas the one in <tmpl_var name=school_id>"> # is a number supplied via @options <select name="school_id"><option selected value="1"><option selected v +alue="0">Select<tmpl_loop name=options> <option value="<tmpl_var name=school_id>"><tmpl_var escape=html name=s +chool></option></tmpl_loop> </select></td></tr>
The above works with the template but I'm not sure if I'm missing something. Note that %hash is passed to &generate (thanks to djantzen for the map) which generates a list which is then supplied to the param of H::T.

In reply to Re: Re: HTML::Template question - tmpl_if by kiat
in thread HTML::Template question - tmpl_if by kiat

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 examining the Monastery: (3)
As of 2024-04-26 05:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found