On modperl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sasimca007
    New Member
    • Sep 2007
    • 129

    On modperl

    Hello friends,
    Actually my doubt is we r using perl code in html but how to use same perl code in javascript? For example,
    I am using one select box onchange i am calling a function and the corresponding values are in perl hash of arrays, so my problem is how to assign those hash of arrays values into another select box through javascript.
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    In my experience (which is very limited), Javascript is its own scripting language apart from Perl CGI. So you may want to stick with either Perl OR Javascript, but not both. It is fairly easy to create checkboxes and the like in Perl, and to change the contents of Perl values in this way.

    Again, I have very little experience in this area, so I could be completely wrong.

    Comment

    • KevinADC
      Recognized Expert Specialist
      • Jan 2007
      • 4092

      #3
      You can't use perl code in html (you can but perlscript is so rarely used I doubt that is what you are doing). You can use perl to print html code, and use perl to print javascript just like you print html. But once the html/javascript is printed to a browser perl has no more communication with the html/javascript code. You have to send some data back to the perl script using a form to make changes to the page. You can use AJAX to do that or traditional CGI forms. Search for AJAX to read about what it is and how you can use it.

      Comment

      Working...