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

Asp to set value of javascript document field value 1

Status
Not open for further replies.

smaggi

Programmer
Feb 28, 2007
1
US
I have a form with a javascript validation function OnSubmit. In the validation function I need to use ASP to set the value of a field to a session value. I tried the following, but it does not work. Let's assume Session("customerNumber") = 30143, then I want document.myForm.customerNumber.value = "30143"


function Validate()
{
document.myForm.customerNumber.value = "<% Session("customerNumber")%>"
return true;
}
 
You are missing one thing (an equals sign):

Code:
 function Validate()
   {
      document.myForm.customerNumber.value = "<%[!]=[/!] Session("customerNumber")%>"
      return true;
   }





[small]"Mom........MEATLOAF!!!! F***!!!!"[/small]
<.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top