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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl and OnBlur

Status
Not open for further replies.

HollyMcB

Programmer
Dec 27, 2002
3
US
I'm new to javascript, so I need a lot of help! I searched the archives and didn't find exactly what I was looking for, if it's even possible.

I have written a page using Perl/CGI and embedded javascript. I have a popup to choose a code and fill in a text box on a form. I would like to display the text description of the code in a static field next to the text box. Getting the text description involves making a trip to the database (Oracle 9i). I wanted to use onBlur or onChange, so when the user enters or changes the code and leaves the field it would update the text description. I wanted the onBlur to fire a Perl sub procedure, but I don't think that is possible.

I could possibly concatinate the code and the description when it comes out of the popup, but is there a way to substring using javascript?

Any suggestions? Thank you in advance for your help.
 
If you just need to know how to use substring:
Code:
<script>
<!--
myString = &quot;foo bar&quot;;
// Format: variable.substring(startIndex,endIndex)
newString = myString.substring(0,3);
alert(newString);
//-->
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top