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

How do i pass an asp variable to a javascript function?

Status
Not open for further replies.

kingpoop

Programmer
Sep 11, 2001
7
US
I would like to declare a date var in
asp and pass it to a javascript function.

I am struggling, thanks for help.
kp

function validatePersonalInfo(form,szDate)
{
alert(szDate)
}

<%
MyDate = Now()
%>

<FORM NAME=&quot;Status&quot; ACTION=&quot;security.asp&quot; METHOD=&quot;post&quot; onSubmit=&quot;return validatePersonalInfo(this,???)&quot;>
 

<script>
var myDate = &quot;<%=now%>&quot;;
</script>
produces

var myDate = &quot;9/03/2002 17:32:22&quot;;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top