p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Client side VBScript


Message #1 by "Jon Ege Ronnenberg" <007-is-his-iq@o...> on Tue, 5 Nov 2002 11:24:46
Thanks for hint Gerhard. It's a intranet app and my client is using IE. 
Now it works.

> Jon

I cut and pasted the the code and placed a button that calls the Sub and
a form. It seems to work ok for me.

<form name=3D"frmBrancheList" action=3D"test.asp" method=3D"post">
<input type=3D"button" onclick=3D"btnSubmitFirm_OnClick" =
value=3D"click">
</form>

I assume that you realize that client side vbscript only works in IE..

Regards,

Gerhard Wentink


>-----Original Message-----
>From: Jon Ege Ronnenberg [mailto:007-is-his-iq@o...]=20
>Sent: Tuesday, November 05, 2002 11:25 AM
>To: Code Clinic
>Subject: [proasp_codeclinic] Client side VBScript
>
>
>I'm a newbie in clientside scripts and I can't figure out why this sub=20
>doesn't work. No matter if I click cancel or ok the form is submitted.
>
>The Client side Script:
><script language=3D"vbscript">
>Sub btnSubmitFirm_OnClick()
>  lngRC =3D MsgBox("Du kan ikke fortryde at slette et branche."=20
>& vbCrLf &_
>  "Er du sikker p=E5, at du vil slette" & _
>  "?",vbOKCANCEL,"Byportalerne - Administration - <%=3D=20
>strBrugerNavn %>")
> =20
>  If lngRC =3D vbOK Then
>    Call frmBranchList.submit()=09
>  End If
>End Sub
></script>
>
>I check to see if the form is submitted like this:
>  If Request.Form("BrancheNavn") <> "" Then
>    call ValidateInput("Brancher")
>    If Session("blnValid") =3D True Then
>      call addStuff("Brancher")
>	Else
>	  Response.Write Session("strAlert")
>	End If
>  ElseIf Request.Form("delBranch") <> "" Then 'Here I do the checking
>	call delStuff("Brancher","BrancheID","delBranch")
>  End If
>
>Then the other sub is called:
>  Sub delStuff(table,IDName,delFields)
>
>    Dim strTemp, MyItem
>	strTemp =3D ""						=09
>	For i=3D1 To Request.Form("" & delFields & "").Count
>	  strSQL =3D "DELETE * FROM " & table & " WHERE "
>	  strTemp =3D Request.Form("" & delFields & "")(i)
>	  If IsNumeric(strTemp) Then
>	    strSQL =3D strSQL & IDName & " =3D " & strTemp & " "
>	  Else
>	    strSQL =3D strSQL & IDName & " =3D '" & strTemp & "' "
>	  End If
>	  objConn.Execute (strSQL)
>	Next
> =20
>  End Sub
>This sub is executed nomatter if I click cancel or not!
>
>I'm not sure this is the right forum, but any help would be nice :-)
> - Jon
>---
>Change your mail options at http://p2p.wrox.com/manager.asp or=20
>to unsubscribe send a blank email to=20
>
>


  Return to Index