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

Pass a parameter from VBScript to Java Function

Status
Not open for further replies.

calandrelli

Technical User
Jun 14, 2002
69
US
I have a pop-up date picker that is written in Javascript that will take a parameter for default date. I use it on two pages... On my Add-a-record page the default value is today but on my edit-record-page I need it to reflect the date already stored for that record. The “Add” page work fine but the edit page uses a SQL statement retrieve a value from the database and stored it in a VBScript variable. I can’t seem to pass that variable on the JavaScript function that creates the calendar.


VBSCRIPT:

query = "Select * from tbl_Main WHERE Request_Nbr = " & key
recordset.Open query, connect

Due_Date = recordset("Due_Date")



JAVASCRIPT:
<script> DateInput(Param 1, Param 2, <%=Due_Date%>) </script>

NOTE: DateInput is run by a separate js file.


I keep getting the error of Due_Date is undefined.
 
It's Javascript, not Java. Those are 2 completely different things.

And don't post the same question in 2 forums unless someone in the first forum tells you it belongs in the second.

Lee
 
Sorry about the dual post. After I thought about it...it seemed more appropriate in the Javascript forum.
 
If you look at the output that is generated (javascript function) you'll probably notice your missing some quotes whereyour printing that date. Since your technically printing javascript code then lettingthe client execute it, it doesn't matter whether a value was hardcoded in or came froma variable, you have to output things like quotes that you would normally type in if it were a hardcoded value.

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top