Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript to Perl 2

Status
Not open for further replies.

refulgent

IS-IT--Management
Jun 12, 2001
24
US
Hi Guys,

I have the following question....

My current page has a pull down menu and submit button, when user clicks on submit data gets retrieved from database and then displayed on the page.

I wanted to change it so that submit button functionality would be replaced by javascript code so that data will be displayed right after user made a selection.

I am wondering if it is possible to do, meaning if is it anyhow possible to pass selected item from javascript to my perl code that does retrieval from the database.

Thank you in advance,

Kate

 
Nope, this is not possible to do with JavaScript as JS is purely a client side language.

To answer the question to your last paragraph, you can, however, allow for your JS to call a CGI file and display the values that way, which is what I am assuming you are asking because the second and third paragraphs kinda contradict each other.

But even if you were able to use JS to do this, it would take as long as using another other method because the JS would have to invoke the database, query it, and return its results.

So this is not possible to do purely with JS, but can be done with both JS and Perl. I would investigate the JavaScript forum on how to do this exactly.

Hope this helps,
-Vic
vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
nope....
javascript is all client side. the Perl is all server side.

Depending on how much information is retrieved from the database, it might be reasonable to create the input page via PHP or Perl/CGI with dynamically created javascript that would have all the information it needed when written to the browser. That way, no database calls would be required after the page is presented to the user. It already has everything it might need to display the required info.

Or,TMTOWTDI....... you could put your javascript to in one window and have it spawn a second window(target) which would call your CGI. The CGI returned content could appear in the second window. Then, each new selection of a pull down item would repopulate the second window. ..... or maybe that would work with frames.....<ponder....ponder....??>

HTH


keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top