I'm using the Template module in a web app. I'm able to output an image inside a div tag without reloading the entire page using the following code in my html template: <img src='user.pl?rm=getimage&image=docidF' height='350' width='750' align='center' border='1'> which calls the subroutine:
sub getimage{ my $self = shift; my $q = $self->query; my $error=''; ... get the image and set $binData to the image data ... print $q->header(-type=>'image/gif', -Content_Length=>length($ +binData)+1).$binData }
which works like a charm. However, I'd like to now do the same thing, except instead of outputting an image, I want to output html without reloading the page. This html would contain the applicable select options based upon a previous answer. I don't want to submit the form and reload the page because honestly, there are too many other variables within the form and it would be a pain to reload. I haven't been able to find anything remotely close to this yet. I'm assuming I'd use a simlar perl subroutine, but I'm not sure how I would call the subroutine in the html template. Is this possible?

In reply to html output to div tag without submitting the form by ksublondie

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.