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!

VbScripting Problem 1

Status
Not open for further replies.

faiyth

Programmer
Nov 22, 2002
19
US
Here's my problem.. I want a msgbox.. so I'm trying to do a function in client side vbscript that passes a value to a function in server side.

Here's the code. Can someone help me figure out how to do this?

<Script language=vbscript>
delete=MsgBox(&quot;Are you sure you want to delete this record?&quot;, VBYesNo, &quot;Delete?&quot;)
if delete=VBYes Then
varDel=&quot;True&quot;
Else
varDel=&quot;False&quot;
End If
OkayDelete(varDel)
</script>
<%
Function OkayDelete(varDel)
if varDel=&quot;True&quot; Then
dim f_NowUpdate
f_NowUpdate=Request.QueryString(&quot;newid&quot;)
db1.execute(&quot;DELETE FROM bug Where BugID=&quot; & f_NowUpdate & &quot;&quot;)
Else
Response.Redirect &quot;bugs.asp&quot;
End If
End Function

 
You can't call a server side function from a client side script.

I think your best option will be to check if they want to delete, if yes, submit a form to an asp page, either the same page or a different one, where your server side code is. Submitting the form takes the information from the client side to the server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top