Re: Function Help Required
- From: "Anthony Jones" <Ant@xxxxxxxxxxxxxxxx>
- Date: Fri, 22 Sep 2006 10:42:44 +0100
"Joe Fawcett" <joefawcett@xxxxxxxxxxxxxxxx> wrote in message
news:eNW%23sKi3GHA.4924@xxxxxxxxxxxxxxxxxxxxxxx
As well as Anthony's suggestion to use view source try double clicking the
error icon to get a full error message. It's likely a syntax error in
client-side script due to lack of a quote or something.
Just remember to use the previous button in the dialog. A syntax error most
often begets other errors typically 'object expected' because event code
tries to run but the function it is trying to call hasn't been built due to
the syntax error.
--Javascript.
Joe Fawcett - MVP
http://joe.fawcett.name
"Anthony Jones" <Ant@xxxxxxxxxxxxxxxx> wrote in message
news:e3SyCVV3GHA.1256@xxxxxxxxxxxxxxxxxxxxxxx
"EA" <NOSPAM@xxxxxxxxxxxx> wrote in message
news:4511b765$0$2654$ed2619ec@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am amending a web site and I have very little knowledge of
say
The function below is something I have pieced together but needlss to
matchit
does not work. When I click the button which has this function as it'sthe
onClick event the web page does not change, but Error on Page appear in
status bar. I know the rest of the page is okay because if I set theaction
of the StatsForm to be Default.asp this works fine.which
The problem is when I try to use the function below to check the input.
Logic.... I have a variable 'Score'. I have an array of PlayerCodes,
have been used to create a series of DB textboxes on the form. The
function, which is invoked when a button is clicked, should add the
values
in all these DB textboxes and compare it to the variable 'Score'. If
they
equal the form should be submitted to default.asp. If they do not
a
messagebox is displayed on the screen.
function TestScore() {
MyVar = <%
MyArr = Split(ArrayOfPlayerCodes)
For x=0 to ubound(MyArr)
%>(Math.round(StatsForm.DB<%=MyArr(x)%>.value)) +<%
Next
%>0
if (MyVar != <%=Score%>) {
alert('Please check your doubles, they do not equal the team score
entered! ')
}else
{
StatsForm.action='Default.asp'
StatsForm.submit()
}
}
Can anyone tell me what my error is?
I suggest that you use view source to see the final javascript generated
by
this code. I suspect that will clue you in to what is wrong with the
code.
Also are you sure all DBxxx inputs are eitther empty or just contain
numerical values.
.
- References:
- Function Help Required
- From: EA
- Re: Function Help Required
- From: Anthony Jones
- Re: Function Help Required
- From: Joe Fawcett
- Function Help Required
- Prev by Date: Re: Function Help Required
- Next by Date: Re: Is there a way to delete a subset (continous) of child nodes?
- Previous by thread: Re: Function Help Required
- Next by thread: New feature in IE7?
- Index(es):