I have thought myself into a box on this one. The background I have a web page that presents multiple forms to fill out. The fields are presented on the page based on Javascript. All of the logic and form checking is handled within Perl. The Javascript is only used for presentation.

I am trying to add a feature where if a Username is filled in the accompanying information will be looked up and automatically populated in other fields (Office location, phone number etc.)

I can't seem to figure out how to implement this within Perl. Javascript supports an onChange function that would allow me to trigger an action when the value changes for Username. But there isn't a method to call a Perl function from Javascript. And I haven't been able to find a Perl function that would trigger when the value in the Username field changes.

Thanks for any help.
Javahead Update Thanks everyone for the input. The web site is "another duty as assigned" so I'm just picking up web techniques. I was able to get the functionality I wanted with the CGI::Ajax module with only minimal changes. The security concerns are minimal. The webserver is internal only and the HR area requires a login and password.

In reply to CGI how to lookup a value when a Field is filled in by javahead

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.