Hi I'm not sure this is the correct forum for this question but here goes. I am passing a value from a form to an ASP page that has some javascript on it to validate a form on the same ASP page. The problem I'm having is using the value from the ASP in the Javascript.Is there a way to use an ASP variable in a javascript. Hmm sounds confusing doesn't it? well here's some of my code.
Hope I've explained things well enough and someone can help. It would be much appreciated.
Code:
Dim MyArray(4,1),pass,nam,i,test
pass = request.form("Password")
nam = request.form("UserID")
MyArray(0,1) = "john"
MyArray(1,1) = "mark"
MyArray(2,1) = "jim"
MyArray(3,1) = "doug"
MyArray(4,1) = "tom"
MyArray(0,0) = "john12"
MyArray(1,0) = "mark12"
MyArray(2,0) = "jim123"
MyArray(3,0) = "doug12"
MyArray(4,0) = "thomas"
for i = 0 to 4
If MyArray(i,1) + MyArray(i,0) = nam + pass Then
test=true
Exit For
End If
next
If test = true then
response.write "You are successfull"
on the same page I need to use the variable nam in a javascript.
ID1=BobForm.usrNam.value;
if(ID1 != nam)
{
alert("Please input a valid username!");
event.returnValue=false;
BobForm.usrNam.focus()
BobForm.usrNam.select()
}