|
-
Jun 12th, 2001, 04:12 PM
#1
Thread Starter
Hyperactive Member
A simple VBScript error
Code:
<html><head><title>Testing, will it work??? Probalbly not!</title></head>
<BODY>
<H1>Welcome to the Visual Basic Quiz!</h1>
Please make a choice by Clciking the appropriate answer<p><br>
What does Stephen Hawking do for a living?<p>
<form name="frm">
<input type="radio" NAME="radq1" CHECKED> Engineer<BR>
<input type="radio" NAME="radq1"> Physisist<BR>
<input type="radio" NAME="radq1"> Accountant<BR>
<input type="radio" NAME="radq1"> Unemployed<BR><br><p>
<input type="button" NAME="B1" Value = "Click to check your answer!"><p>
<INPUT TYPE="text" NAME="txtMsg" Size="50"><p></form>
<SCRIPT LANGUAGE="VBS">
Dim NumGos
Sub b1_Onclick
NumGos = Numgos + 1
if frm.radq1.item(1).checked then
frm.txmsg.value = "Well done! You are right after" & Cstr(NumGos)
if numgos = 1 then
frm.txmsg.value = frm.txmsg.value & "Try"
else
frm.txmsg.value = frm.txmsg.value & "Tries"
end if
if numgos = 2 then
msgbox("Right First Time - Ya lucky git!")
end if
else
frm txmsg.value = "Wrong, ya DUMB ass!"
end if
End Sub
</SCRIPT>
</BODY></HTML>
thats it, and it dont work, just get an error in the status bar that says error on page!
-
Jun 12th, 2001, 04:18 PM
#2
Frenzied Member
Well, I do all of my client side stuff in JavaScript, so I haven't got a care, but..
That line is missing a dot.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Jun 12th, 2001, 04:23 PM
#3
Thread Starter
Hyperactive Member
if your talking about the
frm txmsg.value = "Wrong, ya DUMB ass!"
then it didnt work putting a . inbetweeb the from txmsg
but it does need ot be there so thanx, still an error though
-
Jun 12th, 2001, 05:18 PM
#4
Frenzied Member
You mis-spelled the name of your textbox nearly everywhere.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Jun 13th, 2001, 03:38 AM
#5
Lively Member
and
msgbox("Right First Time - Ya lucky git!")
should be msgbox "Right First Time - Ya lucky git!"
No "(" & ")"
If you want "(" ..
X = msgbox("Are you sure?" ,vbyesno + vbquestion,"Question")
if x = vbyes then
Msgbox "yes"
else
msgobx "no"
end if
-
Jun 13th, 2001, 11:49 AM
#6
Frenzied Member
For that matter, you shouldn't be using Msgbox on a web page at all.. there is a whole other thread on this topic, but suffice to say you should be using:
window.alert "blahblahblah"
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|