I am used to making ASP pages with buttons that submit the form back to
the asp page then analyzing the request object to determine which
buttons was pressed, such as:
if Request("btnSave") = "Save" then ....
Now I am working in VBSCRIPT to do some client side validation:
<SCRIPT LANGUAGE="VBScript">
<!--
Sub btnSave_onclick
Dim InValid
InValid = False
if ltrim(rtrim(Document.frmLabVisit.Elements("AP_DATE").value))="" then
InValid = True
msgbox "Must specify a Date"
Exit Sub
end if
if InValid=False then frmLabVisit.Submit
End Sub
// -->
</SCRIPT>
But when I do things this way, in my Server Side ASP code the
Request("btnSave") is null. So how can I submit the form from my client
side VBScript code and have it set the value of Request("btnSave") so I
can tell in my Server Side code that the user click on save? Or is
there a better way?
I should note that I have a few other buttons to, like Cancel. If the
user clicks cancel then in my local VBScript I ask for confirmation, if
they click yes then I want to submit the page with the
Request("btnDelete") set so my server side ASP will know the user wants
to delete.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!