/    Sign up×
Community /Pin to ProfileBookmark

Baffling mismatch error

Hi,
could some kind expert point me in the right direction with this beginner question.

At this stage I simply want to click to select a checkbox and then click a button that will open a MsgBox and announce which checkbox I clicked.

Depending on which checkbox I clicked I get the error;

[CODE]Line: 55
Char: 1
Error: Type mismatch: ‘RunScript’
Code:0
URL: http://bla bla bla[/CODE]

Here is my code;

[CODE]<html>
<head>
<title>My Page</title>
<script type=”text/VBScript” language=”VBScript”>
Sub RunScript()
If b80.checked Then
Runb80()
End If
If b8vpn checked Then
Runb8vpn()
End If
If bdevo checked Then
Runbdevo()
End If
If bdevvpn checked Then
Runbdevvpn()
End If
If b70 checked Then
Runb70()
End If
If b7vpn checked Then
Runb7vpn()
End If
End Sub
Sub Runb80()
MsgBox(“you called Runb80”)
End Sub
Sub Runb8vpn()
MsgBox(“you called Runb8vpn”)
End Sub
Sub Rundevo()
MsgBox(“you called Rundevo”)
End Sub
Sub Runbdevvpn()
MsgBox(“you called Runbdevvpn”)
End Sub
Sub Runb70()
MsgBox(“you called Runb70”)
End Sub
Sub Runb7vpn()
MsgBox(“you called Runb7vpn”)
End Sub
</Script>
</head>
<body>
<form name=”myform” action=””>
<div><br>
<input type=”checkbox” name=”b80″ value=”b80″> b80<br>
<input type=”checkbox” name=”b8vpn” value=”b8vpn”> b8vpn<br>
<input type=”checkbox” name=”bdevo” value=”bdevo”> bdevo
<input type=”checkbox” name=”bdevvpn” value=”bdevvpn”> bdevvpn<br>
<input type=”checkbox” name=”b70″ value=”b70″> b70<br>
<input type=”checkbox” name=”b7vpn” value=”b7vpn”> b7vpn<br>
<input type=”button” value=”Run” name=”run_button” onClick=”RunScript()”>
</div>
</form>
</div>
</form>
</body>
</html>[/CODE]

Thank you to any kind expert that can spot the flaw for me.

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@tracknutMay 23.2009 — 
[CODE]
<html>
<head>
<title>My Page</title>
<script type="text/VBScript" language="VBScript">
Sub RunScript()
If b80.checked Then
Runb80()
End If
If b8vpn checked Then
Runb8vpn()
End If
[/CODE]

[/QUOTE]


I've never seen VBScript before, but it looks odd to me that you have "b80.checked" on the first one, and "b8vpn checked" (with no dot) in all the rest...

Dave
Copy linkTweet thisAlerts:
@CityGalauthorMay 23.2009 — Thanks for that advice Dave.

The code now looks like this.

[CODE]<html>
<head>
<title>My Page</title>
<script type="text/VBScript" language="VBScript">
Sub RunScript()
If b80.checked Then
Runb80()
End If
If b8vpn.checked Then
Runb8vpn()
End If
If bdevo.checked Then
Runbdevo()
End If
If bdevvpn.checked Then
Runbdevvpn()
End If
If b70.checked Then
Runb70()
End If
If b7vpn.checked Then
Runb7vpn()
End If
End Sub
Sub Runb80()
MsgBox("you called Runb80")
End Sub
Sub Runb8vpn()
MsgBox("you called Runb8vpn")
End Sub
Sub Rundevo()
MsgBox("you called Rundevo")
End Sub
Sub Runbdevvpn()
MsgBox("you called Runbdevvpn")
End Sub
Sub Runb70()
MsgBox("you called Runb70")
End Sub
Sub Runb7vpn()
MsgBox("you called Runb7vpn")
End Sub
</Script>
</head>
<body>
<form name="myform" action="">
<div><br>
<input type="checkbox" name="b80" value="b80"> b80<br>
<input type="checkbox" name="b8vpn" value="b8vpn"> b8vpn<br>
<input type="checkbox" name="bdevo" value="bdevo"> bdevo
<input type="checkbox" name="bdevvpn" value="bdevvpn"> bdevvpn<br>
<input type="checkbox" name="b70" value="b70"> b70<br>
<input type="checkbox" name="b7vpn" value="b7vpn"> b7vpn<br>
<input type="button" value="Run" name="run_button" onClick="RunScript()">
</div>
</form>
</div>
</form>
</body>
</html>[/CODE]


and the error looks like this;

[CODE]Line: 6
Char: 1
Error: Object required:'b80'
Code:0
URL:http://bla bla bla[/CODE]


Thank you again for your help
×

Success!

Help @CityGal spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...