VBscript messagbox and validation

They have: 5,633 posts

Joined: Jan 1970

I'm working on a validation script for my ASP page. I'm validation with the isLength value and i want to see wich form field has been left zero. I can't put the form field in a variable My script has the folowing lines:

function isLength(val)
is len(val.value)>0 then
islength=true
else Msgbox "Value of field" & document.formname.formfiled& "can't bne zero"
val.select
isLength=false
end if

end fucntion

function check ()
if not islength(document.formname.formfield) then exit function
end if

msgbox ("Data is correct and can be submitted")
document.formname.submit()
end function

My problem is now the line where the msgbox is executed :

else Msgbox "Value of field" & document.formname.formfiled& "can't be zero"

i want in the messagebox the field which has been left zero and the message i get is

Value of field [object] can't be zero.

Can anyone help me thanx anyway

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

try using:

Value of field" & (document.formname.formfield)& "can't be zero"

Im not sure but you can always give it a try.
Else you got to ask Aldrin or Hans. They know these things;^)

[This message has been edited by Jack Michaelson (edited 10 December 1999).]

Shakespeare: onclick || !(onclick)

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.