|
 |
asp_web_howto thread: RE: VBScript Problem
Message #1 by "Chris Thompson" <cthompson@n...> on Mon, 20 May 2002 13:34:11 -0600
|
|
I know this is more VB script client side versus VBscript server side
(ASP), but can anyone help me here?
I have a form and want to test dome fields before I submit it. I have s
function that is called from the 'OnSUBMIT' parameter of the FORM tag.
It calls the function correctly, but I am trying to get it to stop the
form processing. Here is some of my code:
<SCRIPT LANGUAGE=3D'VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
CheckSubmit =3D false
End Function
</SCRIPT>
<FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'CheckSubmit()'>
...
</FORM>
Anyone have any ideas as to why the 'CheckSubmit =3D false' is not
working? I have also tried 'return false' in place of it, but that
gives me an error. When I hit the submit button, it shows the msgbos,
then forwards to the next page. I need it to stop. Any help would be
greaty appreciated.
Thanks in advance,
Chris
Message #2 by "Debreceni, David" <david_debreceni@r...> on Mon, 20 May 2002 15:38:02 -0400
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C20035.DAD257C0
Content-Type: text/plain;
charset="iso-8859-1"
Try this ONSUBMIT='return CheckSubmit()'
I think you have to have a return there.
Hope that helps
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
-----Original Message-----
From: Chris Thompson [mailto:cthompson@n...]
Sent: Monday, May 20, 2002 3:34 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
I know this is more VB script client side versus VBscript server side
(ASP), but can anyone help me here?
I have a form and want to test dome fields before I submit it. I have s
function that is called from the 'OnSUBMIT' parameter of the FORM tag.
It calls the function correctly, but I am trying to get it to stop the
form processing. Here is some of my code:
<SCRIPT LANGUAGE='VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
CheckSubmit = false
End Function
</SCRIPT>
<FORM ACTION='processaddmain.asp' METHOD=POST ONSUBMIT='CheckSubmit()'>
...
</FORM>
Anyone have any ideas as to why the 'CheckSubmit = false' is not
working? I have also tried 'return false' in place of it, but that
gives me an error. When I hit the submit button, it shows the msgbos,
then forwards to the next page. I need it to stop. Any help would be
greaty appreciated.
Thanks in advance,
Chris
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #3 by "Chris Thompson" <cthompson@n...> on Mon, 20 May 2002 13:41:11 -0600
|
|
This is a multi-part message in MIME format.
------_=_NextPart_001_01C20036.4B4BCF14
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
I get an error with this line:
<FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST ONSUBMIT=3D'return
CheckSubmit()'>
-----Original Message-----
From: Debreceni, David [mailto:david_debreceni@r...]
Sent: Monday, May 20, 2002 1:38 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
Try this ONSUBMIT=3D'return CheckSubmit()'
I think you have to have a return there.
Hope that helps
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
-----Original Message-----
From: Chris Thompson [mailto:cthompson@n...]
Sent: Monday, May 20, 2002 3:34 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
I know this is more VB script client side versus VBscript server side
(ASP), but can anyone help me here?
I have a form and want to test dome fields before I submit it. I have s
function that is called from the 'OnSUBMIT' parameter of the FORM tag.
It calls the function correctly, but I am trying to get it to stop the
form processing. Here is some of my code:
<SCRIPT LANGUAGE=3D'VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
CheckSubmit =3D false
End Function
</SCRIPT>
<FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'CheckSubmit()'>
...
</FORM>
Anyone have any ideas as to why the 'CheckSubmit =3D false' is not
working? I have also tried 'return false' in place of it, but that
gives me an error. When I hit the submit button, it shows the msgbos,
then forwards to the next page. I need it to stop. Any help would be
greaty appreciated.
Thanks in advance,
Chris
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20 ---
Message #4 by jstmehr4u3@a... on Mon, 20 May 2002 19:45:17 +0000
|
|
Try Return:CheckSubmit()...
The problem is that you are not checking to see if the
value being returned is True Or False. In your form, put
in a hidden input field, with CheckSubmit() as your
value, and see what value is being passed, true or false.
> I get an error with this line:
>
>
>
>
>
> <FORM ACTION='processaddmain.asp' METHOD=POST ONSUBMIT='return
> CheckSubmit()'>
>
>
>
>
>
> -----Original Message-----
> From: Debreceni, David [mailto:david_debreceni@r...]
> Sent: Monday, May 20, 2002 1:38 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
>
>
> Try this ONSUBMIT='return CheckSubmit()'
> I think you have to have a return there.
> Hope that helps
>
> David Debreceni
> Senior Visual Basic/ASP Developer
> xxx-xxx-xxxx x 1086
>
>
>
> -----Original Message-----
> From: Chris Thompson [mailto:cthompson@n...]
> Sent: Monday, May 20, 2002 3:34 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
>
>
> I know this is more VB script client side versus VBscript server side
> (ASP), but can anyone help me here?
>
> I have a form and want to test dome fields before I submit it. I have s
>
> function that is called from the 'OnSUBMIT' parameter of the FORM tag.
> It calls the function correctly, but I am trying to get it to stop the
> form processing. Here is some of my code:
>
> <SCRIPT LANGUAGE='VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> CheckSubmit = false
> End Function
> </SCRIPT>
>
> <FORM ACTION='processaddmain.asp' METHOD=POST ONSUBMIT='CheckSubmit()'>
>
> ...
>
> </FORM>
>
> Anyone have any ideas as to why the 'CheckSubmit = false' is not
> working? I have also tried 'return false' in place of it, but that
> gives me an error. When I hit the submit button, it shows the msgbos,
> then forwards to the next page. I need it to stop. Any help would be
> greaty appreciated.
>
> Thanks in advance,
>
> Chris
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
>
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
>
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
>
> r-20
> ---
>
> --- Improve your web design skills with these new books from Glasshaus.
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20 Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20 Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20 ---
>
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
>
>
Message #5 by "Chris Thompson" <cthompson@n...> on Mon, 20 May 2002 13:52:46 -0600
|
|
If I do it like this, I get a type mismatch error on return.
<SCRIPT LANGUAGE=3D'VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
msgbox CheckSubmit
CheckSubmit =3D false
msgbox CheckSubmit
End Function
</SCRIPT>
<FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'return:CheckSubmit()'>
If I do it like this, The last msgbox says false, so the function is
getting a false value. I can only assume it is not getting back then
because it still submits
<SCRIPT LANGUAGE=3D'VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
msgbox CheckSubmit
CheckSubmit =3D false
msgbox CheckSubmit
End Function
</SCRIPT>
<FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'CheckSubmit()'>
-----Original Message-----
From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]
Sent: Monday, May 20, 2002 1:45 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
Try Return:CheckSubmit()...
The problem is that you are not checking to see if the
value being returned is True Or False. In your form, put
in a hidden input field, with CheckSubmit() as your
value, and see what value is being passed, true or false.
> I get an error with this line:
>
>
>
>
>
> <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST ONSUBMIT=3D'return
> CheckSubmit()'>
>
>
>
>
>
> -----Original Message-----
> From: Debreceni, David [mailto:david_debreceni@r...]
> Sent: Monday, May 20, 2002 1:38 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
>
>
> Try this ONSUBMIT=3D'return CheckSubmit()'
> I think you have to have a return there.
> Hope that helps
>
> David Debreceni
> Senior Visual Basic/ASP Developer
> xxx-xxx-xxxx x 1086
>
>
>
> -----Original Message-----
> From: Chris Thompson [mailto:cthompson@n...]
> Sent: Monday, May 20, 2002 3:34 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
>
>
> I know this is more VB script client side versus VBscript server side
> (ASP), but can anyone help me here?
>
> I have a form and want to test dome fields before I submit it. I have
s
>
> function that is called from the 'OnSUBMIT' parameter of the FORM tag.
> It calls the function correctly, but I am trying to get it to stop the
> form processing. Here is some of my code:
>
> <SCRIPT LANGUAGE=3D'VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> CheckSubmit =3D false
> End Function
> </SCRIPT>
>
> <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'CheckSubmit()'>
>
> ...
>
> </FORM>
>
> Anyone have any ideas as to why the 'CheckSubmit =3D false' is not
> working? I have also tried 'return false' in place of it, but that
> gives me an error. When I hit the submit button, it shows the msgbos,
> then forwards to the next page. I need it to stop. Any help would be
> greaty appreciated.
>
> Thanks in advance,
>
> Chris
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
>
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
>
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
>
> r-20
>
> --- Improve your web design skills with these new books from
Glasshaus.
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> r-20 Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> r-20 Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> r-20 ---
>
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> r-20
>
>
>
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #6 by "Debreceni, David" <david_debreceni@r...> on Mon, 20 May 2002 15:56:19 -0400
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C20038.6896D840
Content-Type: text/plain;
charset="iso-8859-1"
This should work
<SCRIPT LANGUAGE='VBSCRIPT'>
Function f1_onsubmit()
msgbox "HI"
f1_onsubmit = False
End Function
</SCRIPT>
<FORM ACTION='processaddmain.asp' NAME="f1" METHOD=POST >
<Input TYPE="Submit" NAME="d">
</FORM>
Need to have a name for your form.
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
-----Original Message-----
From: Chris Thompson [mailto:cthompson@n...]
Sent: Monday, May 20, 2002 3:53 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
If I do it like this, I get a type mismatch error on return.
<SCRIPT LANGUAGE='VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
msgbox CheckSubmit
CheckSubmit = false
msgbox CheckSubmit
End Function
</SCRIPT>
<FORM ACTION='processaddmain.asp' METHOD=POST
ONSUBMIT='return:CheckSubmit()'>
If I do it like this, The last msgbox says false, so the function is
getting a false value. I can only assume it is not getting back then
because it still submits
<SCRIPT LANGUAGE='VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
msgbox CheckSubmit
CheckSubmit = false
msgbox CheckSubmit
End Function
</SCRIPT>
<FORM ACTION='processaddmain.asp' METHOD=POST ONSUBMIT='CheckSubmit()'>
-----Original Message-----
From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]
Sent: Monday, May 20, 2002 1:45 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
Try Return:CheckSubmit()...
The problem is that you are not checking to see if the
value being returned is True Or False. In your form, put
in a hidden input field, with CheckSubmit() as your
value, and see what value is being passed, true or false.
> I get an error with this line:
>
>
>
>
>
> <FORM ACTION='processaddmain.asp' METHOD=POST ONSUBMIT='return
> CheckSubmit()'>
>
>
>
>
>
> -----Original Message-----
> From: Debreceni, David [mailto:david_debreceni@r...]
> Sent: Monday, May 20, 2002 1:38 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
>
>
> Try this ONSUBMIT='return CheckSubmit()'
> I think you have to have a return there.
> Hope that helps
>
> David Debreceni
> Senior Visual Basic/ASP Developer
> xxx-xxx-xxxx x 1086
>
>
>
> -----Original Message-----
> From: Chris Thompson [mailto:cthompson@n...]
> Sent: Monday, May 20, 2002 3:34 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
>
>
> I know this is more VB script client side versus VBscript server side
> (ASP), but can anyone help me here?
>
> I have a form and want to test dome fields before I submit it. I have
s
>
> function that is called from the 'OnSUBMIT' parameter of the FORM tag.
> It calls the function correctly, but I am trying to get it to stop the
> form processing. Here is some of my code:
>
> <SCRIPT LANGUAGE='VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> CheckSubmit = false
> End Function
> </SCRIPT>
>
> <FORM ACTION='processaddmain.asp' METHOD=POST
ONSUBMIT='CheckSubmit()'>
>
> ...
>
> </FORM>
>
> Anyone have any ideas as to why the 'CheckSubmit = false' is not
> working? I have also tried 'return false' in place of it, but that
> gives me an error. When I hit the submit button, it shows the msgbos,
> then forwards to the next page. I need it to stop. Any help would be
> greaty appreciated.
>
> Thanks in advance,
>
> Chris
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
>
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
>
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
>
> r-20
> ---
>
> --- Improve your web design skills with these new books from
Glasshaus.
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20 Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20 Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20 ---
>
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
>
>
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #7 by jstmehr4u3@a... on Mon, 20 May 2002 20:07:04 +0000
|
|
VBScript does not have datatypes. It does not know that
your CheckSubmit Function is supposed to be boolean.
Either try FALSE, all uppercase, or "false", in quotes.
> If I do it like this, I get a type mismatch error on return.
>
> <SCRIPT LANGUAGE='VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> msgbox CheckSubmit
> CheckSubmit = false
> msgbox CheckSubmit
> End Function
> </SCRIPT>
>
> <FORM ACTION='processaddmain.asp' METHOD=POST
> ONSUBMIT='return:CheckSubmit()'>
>
>
>
>
> If I do it like this, The last msgbox says false, so the function is
> getting a false value. I can only assume it is not getting back then
> because it still submits
>
> <SCRIPT LANGUAGE='VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> msgbox CheckSubmit
> CheckSubmit = false
> msgbox CheckSubmit
> End Function
> </SCRIPT>
>
> <FORM ACTION='processaddmain.asp' METHOD=POST ONSUBMIT='CheckSubmit()'>
>
>
>
> -----Original Message-----
> From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]
> Sent: Monday, May 20, 2002 1:45 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
> Try Return:CheckSubmit()...
>
> The problem is that you are not checking to see if the
> value being returned is True Or False. In your form, put
> in a hidden input field, with CheckSubmit() as your
> value, and see what value is being passed, true or false.
> > I get an error with this line:
> >
> >
> >
> >
> >
> > <FORM ACTION='processaddmain.asp' METHOD=POST ONSUBMIT='return
> > CheckSubmit()'>
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Debreceni, David [mailto:david_debreceni@r...]
> > Sent: Monday, May 20, 2002 1:38 PM
> > To: ASP Web HowTo
> > Subject: [asp_web_howto] RE: VBScript Problem
> >
> >
> >
> > Try this ONSUBMIT='return CheckSubmit()'
> > I think you have to have a return there.
> > Hope that helps
> >
> > David Debreceni
> > Senior Visual Basic/ASP Developer
> > xxx-xxx-xxxx x 1086
> >
> >
> >
> > -----Original Message-----
> > From: Chris Thompson [mailto:cthompson@n...]
> > Sent: Monday, May 20, 2002 3:34 PM
> > To: ASP Web HowTo
> > Subject: [asp_web_howto] RE: VBScript Problem
> >
> >
> >
> > I know this is more VB script client side versus VBscript server side
> > (ASP), but can anyone help me here?
> >
> > I have a form and want to test dome fields before I submit it. I have
> s
> >
> > function that is called from the 'OnSUBMIT' parameter of the FORM tag.
>
> > It calls the function correctly, but I am trying to get it to stop the
>
> > form processing. Here is some of my code:
> >
> > <SCRIPT LANGUAGE='VBSCRIPT'>
> > Function CheckSubmit()
> > msgbox "HI"
> > CheckSubmit = false
> > End Function
> > </SCRIPT>
> >
> > <FORM ACTION='processaddmain.asp' METHOD=POST
> ONSUBMIT='CheckSubmit()'>
> >
> > ...
> >
> > </FORM>
> >
> > Anyone have any ideas as to why the 'CheckSubmit = false' is not
> > working? I have also tried 'return false' in place of it, but that
> > gives me an error. When I hit the submit button, it shows the msgbos,
>
> > then forwards to the next page. I need it to stop. Any help would be
> > greaty appreciated.
> >
> > Thanks in advance,
> >
> > Chris
> >
> >
> >
> > ---
> >
> > Improve your web design skills with these new books from Glasshaus.
> >
> > Usable Web Menus
> >
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> >
> > r-20
> > Constructing Accessible Web Sites
> >
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> >
> > r-20
> > Practical JavaScript for the Usable Web
> >
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> >
> > r-20
> > ---
> >
> > --- Improve your web design skills with these new books from
> Glasshaus.
> > Usable Web Menus
> >
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> > r-20 Constructing Accessible Web Sites
> >
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> > r-20 Practical JavaScript for the Usable Web
> >
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> > r-20 ---
> >
> >
> >
> >
> > ---
> >
> > Improve your web design skills with these new books from Glasshaus.
> >
> > Usable Web Menus
> >
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> > r-20
> > Constructing Accessible Web Sites
> >
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> > r-20
> > Practical JavaScript for the Usable Web
> >
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> > r-20
> >
> >
> >
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
> http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
> r-20
> Constructing Accessible Web Sites
> http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
> r-20
> Practical JavaScript for the Usable Web
> http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
> r-20
Message #8 by "Chris Thompson" <cthompson@n...> on Mon, 20 May 2002 14:07:33 -0600
|
|
This is a multi-part message in MIME format.
------_=_NextPart_001_01C20039.FAB0FFF8
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Not sure what the deal is. This one says invalid character when the
page loads. Tried debugger. On line that has 'f1_onsubmit=3Dfalse'
Thanks for all the help from everyone. If you all have any more ideas,
I am still hoping for a solution.
Thanks,
Chris
-----Original Message-----
From: Debreceni, David [mailto:david_debreceni@r...]
Sent: Monday, May 20, 2002 1:56 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
This should work
<SCRIPT LANGUAGE=3D'VBSCRIPT'>
Function f1_onsubmit()
msgbox "HI"
f1_onsubmit =3D False
End Function
</SCRIPT>
<FORM ACTION=3D'processaddmain.asp' NAME=3D"f1" METHOD=3DPOST >
<Input TYPE=3D"Submit" NAME=3D"d">
</FORM>
Need to have a name for your form.
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
-----Original Message-----
From: Chris Thompson [mailto:cthompson@n...]
Sent: Monday, May 20, 2002 3:53 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
If I do it like this, I get a type mismatch error on return.
<SCRIPT LANGUAGE=3D'VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
msgbox CheckSubmit
CheckSubmit =3D false
msgbox CheckSubmit
End Function
</SCRIPT>
<FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'return:CheckSubmit()'>
If I do it like this, The last msgbox says false, so the function is
getting a false value. I can only assume it is not getting back then
because it still submits
<SCRIPT LANGUAGE=3D'VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
msgbox CheckSubmit
CheckSubmit =3D false
msgbox CheckSubmit
End Function
</SCRIPT>
<FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'CheckSubmit()'>
-----Original Message-----
From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]
Sent: Monday, May 20, 2002 1:45 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
Try Return:CheckSubmit()...
The problem is that you are not checking to see if the
value being returned is True Or False. In your form, put
in a hidden input field, with CheckSubmit() as your
value, and see what value is being passed, true or false.
> I get an error with this line:
>
>
>
>
>
> <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST ONSUBMIT=3D'return
> CheckSubmit()'>
>
>
>
>
>
> -----Original Message-----
> From: Debreceni, David [mailto:david_debreceni@r...]
> Sent: Monday, May 20, 2002 1:38 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
>
>
> Try this ONSUBMIT=3D'return CheckSubmit()'
> I think you have to have a return there.
> Hope that helps
>
> David Debreceni
> Senior Visual Basic/ASP Developer
> xxx-xxx-xxxx x 1086
>
>
>
> -----Original Message-----
> From: Chris Thompson [mailto:cthompson@n...]
> Sent: Monday, May 20, 2002 3:34 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
>
>
> I know this is more VB script client side versus VBscript server side
> (ASP), but can anyone help me here?
>
> I have a form and want to test dome fields before I submit it. I have
s
>
> function that is called from the 'OnSUBMIT' parameter of the FORM tag.
> It calls the function correctly, but I am trying to get it to stop the
> form processing. Here is some of my code:
>
> <SCRIPT LANGUAGE=3D'VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> CheckSubmit =3D false
> End Function
> </SCRIPT>
>
> <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'CheckSubmit()'>
>
> ...
>
> </FORM>
>
> Anyone have any ideas as to why the 'CheckSubmit =3D false' is not
> working? I have also tried 'return false' in place of it, but that
> gives me an error. When I hit the submit button, it shows the msgbos,
> then forwards to the next page. I need it to stop. Any help would be
> greaty appreciated.
>
> Thanks in advance,
>
> Chris
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
>
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
>
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
>
> r-20
>
> --- Improve your web design skills with these new books from
Glasshaus.
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> r-20 Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> r-20 Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> r-20 ---
>
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> r-20
>
>
>
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20 ---
Message #9 by "Chris Thompson" <cthompson@n...> on Mon, 20 May 2002 14:10:13 -0600
|
|
Those didn't work either.
-----Original Message-----
From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]
Sent: Monday, May 20, 2002 2:07 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
VBScript does not have datatypes. It does not know that
your CheckSubmit Function is supposed to be boolean.
Either try FALSE, all uppercase, or "false", in quotes.
> If I do it like this, I get a type mismatch error on return.
>
> <SCRIPT LANGUAGE=3D'VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> msgbox CheckSubmit
> CheckSubmit =3D false
> msgbox CheckSubmit
> End Function
> </SCRIPT>
>
> <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
> ONSUBMIT=3D'return:CheckSubmit()'>
>
>
>
>
> If I do it like this, The last msgbox says false, so the function is
> getting a false value. I can only assume it is not getting back then
> because it still submits
>
> <SCRIPT LANGUAGE=3D'VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> msgbox CheckSubmit
> CheckSubmit =3D false
> msgbox CheckSubmit
> End Function
> </SCRIPT>
>
> <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'CheckSubmit()'>
>
>
>
> -----Original Message-----
> From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]
> Sent: Monday, May 20, 2002 1:45 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
> Try Return:CheckSubmit()...
>
> The problem is that you are not checking to see if the
> value being returned is True Or False. In your form, put
> in a hidden input field, with CheckSubmit() as your
> value, and see what value is being passed, true or false.
> > I get an error with this line:
> >
> >
> >
> >
> >
> > <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST ONSUBMIT=3D'return
> > CheckSubmit()'>
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Debreceni, David [mailto:david_debreceni@r...]
> > Sent: Monday, May 20, 2002 1:38 PM
> > To: ASP Web HowTo
> > Subject: [asp_web_howto] RE: VBScript Problem
> >
> >
> >
> > Try this ONSUBMIT=3D'return CheckSubmit()'
> > I think you have to have a return there.
> > Hope that helps
> >
> > David Debreceni
> > Senior Visual Basic/ASP Developer
> > xxx-xxx-xxxx x 1086
> >
> >
> >
> > -----Original Message-----
> > From: Chris Thompson [mailto:cthompson@n...]
> > Sent: Monday, May 20, 2002 3:34 PM
> > To: ASP Web HowTo
> > Subject: [asp_web_howto] RE: VBScript Problem
> >
> >
> >
> > I know this is more VB script client side versus VBscript server
side
> > (ASP), but can anyone help me here?
> >
> > I have a form and want to test dome fields before I submit it. I
have
> s
> >
> > function that is called from the 'OnSUBMIT' parameter of the FORM
tag.
>
> > It calls the function correctly, but I am trying to get it to stop
the
>
> > form processing. Here is some of my code:
> >
> > <SCRIPT LANGUAGE=3D'VBSCRIPT'>
> > Function CheckSubmit()
> > msgbox "HI"
> > CheckSubmit =3D false
> > End Function
> > </SCRIPT>
> >
> > <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
> ONSUBMIT=3D'CheckSubmit()'>
> >
> > ...
> >
> > </FORM>
> >
> > Anyone have any ideas as to why the 'CheckSubmit =3D false' is not
> > working? I have also tried 'return false' in place of it, but that
> > gives me an error. When I hit the submit button, it shows the
msgbos,
>
> > then forwards to the next page. I need it to stop. Any help would
be
> > greaty appreciated.
> >
> > Thanks in advance,
> >
> > Chris
> >
> >
> >
> > ---
> >
> > Improve your web design skills with these new books from Glasshaus.
> >
> > Usable Web Menus
> >
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> >
> > r-20
> > Constructing Accessible Web Sites
> >
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> >
> > r-20
> > Practical JavaScript for the Usable Web
> >
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> >
> > r-20
> >
> > --- Improve your web design skills with these new books from
> Glasshaus.
> > Usable Web Menus
> >
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> > r-20 Constructing Accessible Web Sites
> >
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> > r-20 Practical JavaScript for the Usable Web
> >
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> > r-20 ---
> >
> >
> >
> >
> > ---
> >
> > Improve your web design skills with these new books from Glasshaus.
> >
> > Usable Web Menus
> >
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> > r-20
> > Constructing Accessible Web Sites
> >
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> > r-20
> > Practical JavaScript for the Usable Web
> >
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> > r-20
> >
> >
> >
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> r-20
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
> r-20
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #10 by "Debreceni, David" <david_debreceni@r...> on Mon, 20 May 2002 16:18:51 -0400
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C2003B.8EAD2EA0
Content-Type: text/plain;
charset="iso-8859-1"
the f1 is the name of your form. what ever you name your form is what that
would be. Other than that I am not sure. I ran the example exactly as it
is below and it worked fine, it stopped the submit of the page. The other
way you could do it is change your submit to a button, use the onclick
method to validate your stuff and when you are happy call, "form
name".submit and that should submit your form. either that or use java
scripting.
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
-----Original Message-----
From: Chris Thompson [mailto:cthompson@n...]
Sent: Monday, May 20, 2002 4:08 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
Not sure what the deal is. This one says invalid character when the page
loads. Tried debugger. On line that has 'f1_onsubmit=false'
Thanks for all the help from everyone. If you all have any more ideas, I am
still hoping for a solution.
Thanks,
Chris
-----Original Message-----
From: Debreceni, David [mailto:david_debreceni@r...]
Sent: Monday, May 20, 2002 1:56 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
This should work
<SCRIPT LANGUAGE='VBSCRIPT'>
Function f1_onsubmit()
msgbox "HI"
f1_onsubmit = False
End Function
</SCRIPT>
<FORM ACTION='processaddmain.asp' NAME="f1" METHOD=POST >
<Input TYPE="Submit" NAME="d">
</FORM>
Need to have a name for your form.
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
-----Original Message-----
From: Chris Thompson [ mailto:cthompson@n...
<mailto:cthompson@n...> ]
Sent: Monday, May 20, 2002 3:53 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
If I do it like this, I get a type mismatch error on return.
<SCRIPT LANGUAGE='VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
msgbox CheckSubmit
CheckSubmit = false
msgbox CheckSubmit
End Function
</SCRIPT>
<FORM ACTION='processaddmain.asp' METHOD=POST
ONSUBMIT='return:CheckSubmit()'>
If I do it like this, The last msgbox says false, so the function is
getting a false value. I can only assume it is not getting back then
because it still submits
<SCRIPT LANGUAGE='VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
msgbox CheckSubmit
CheckSubmit = false
msgbox CheckSubmit
End Function
</SCRIPT>
<FORM ACTION='processaddmain.asp' METHOD=POST ONSUBMIT='CheckSubmit()'>
-----Original Message-----
From: jstmehr4u3@a... [ mailto:jstmehr4u3@a...
<mailto:jstmehr4u3@a...> ]
Sent: Monday, May 20, 2002 1:45 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
Try Return:CheckSubmit()...
The problem is that you are not checking to see if the
value being returned is True Or False. In your form, put
in a hidden input field, with CheckSubmit() as your
value, and see what value is being passed, true or false.
> I get an error with this line:
>
>
>
>
>
> <FORM ACTION='processaddmain.asp' METHOD=POST ONSUBMIT='return
> CheckSubmit()'>
>
>
>
>
>
> -----Original Message-----
> From: Debreceni, David [ mailto:david_debreceni@r...
<mailto:david_debreceni@r...> ]
> Sent: Monday, May 20, 2002 1:38 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
>
>
> Try this ONSUBMIT='return CheckSubmit()'
> I think you have to have a return there.
> Hope that helps
>
> David Debreceni
> Senior Visual Basic/ASP Developer
> xxx-xxx-xxxx x 1086
>
>
>
> -----Original Message-----
> From: Chris Thompson [ mailto:cthompson@n...
<mailto:cthompson@n...> ]
> Sent: Monday, May 20, 2002 3:34 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
>
>
> I know this is more VB script client side versus VBscript server side
> (ASP), but can anyone help me here?
>
> I have a form and want to test dome fields before I submit it. I have
s
>
> function that is called from the 'OnSUBMIT' parameter of the FORM tag.
> It calls the function correctly, but I am trying to get it to stop the
> form processing. Here is some of my code:
>
> <SCRIPT LANGUAGE='VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> CheckSubmit = false
> End Function
> </SCRIPT>
>
> <FORM ACTION='processaddmain.asp' METHOD=POST
ONSUBMIT='CheckSubmit()'>
>
> ...
>
> </FORM>
>
> Anyone have any ideas as to why the 'CheckSubmit = false' is not
> working? I have also tried 'return false' in place of it, but that
> gives me an error. When I hit the submit button, it shows the msgbos,
> then forwards to the next page. I need it to stop. Any help would be
> greaty appreciated.
>
> Thanks in advance,
>
> Chris
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme>
>
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme>
>
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme>
>
> r-20
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp
<http://p2p.wrox.com/manager.asp> or
>
> --- Improve your web design skills with these new books from
Glasshaus.
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme>
> r-20 Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme>
> r-20 Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme>
> r-20 ---
> Change your mail options at http://p2p.wrox.com/manager.asp
<http://p2p.wrox.com/manager.asp> or
>
>
>
>
> ---
>
> Improve your web design skills with these new books from Glasshaus.
>
> Usable Web Menus
>
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme>
> r-20
> Constructing Accessible Web Sites
>
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme>
> r-20
> Practical JavaScript for the Usable Web
>
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme>
> r-20
>
>
> ---
> Change your mail options at http://p2p.wrox.com/manager.asp
<http://p2p.wrox.com/manager.asp> or
>
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme>
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme>
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme>
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp
<http://p2p.wrox.com/manager.asp> or
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme>
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme>
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
<http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme>
r-20
---
Change your mail options at http://p2p.wrox.com/manager.asp
<http://p2p.wrox.com/manager.asp> or
--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20 ---
--- Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20 Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20 Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20 ---
Message #11 by "Drew, Ron" <RDrew@B...> on Mon, 20 May 2002 18:37:20 -0400
|
|
Not sure this is the answer because I use Javascript...but I think you
have to let the OnSubmit know to return
<FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST ONSUBMIT=3D'return
CheckSubmit()'>
-----Original Message-----
From: Chris Thompson [mailto:cthompson@n...]
Sent: Monday, May 20, 2002 3:34 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
I know this is more VB script client side versus VBscript server side
(ASP), but can anyone help me here?
I have a form and want to test dome fields before I submit it. I have s
function that is called from the 'OnSUBMIT' parameter of the FORM tag.
It calls the function correctly, but I am trying to get it to stop the
form processing. Here is some of my code:
<SCRIPT LANGUAGE=3D'VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
CheckSubmit =3D false
End Function
</SCRIPT>
<FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'CheckSubmit()'>
...
</FORM>
Anyone have any ideas as to why the 'CheckSubmit =3D false' is not
working? I have also tried 'return false' in place of it, but that
gives me an error. When I hit the submit button, it shows the msgbos,
then forwards to the next page. I need it to stop. Any help would be
greaty appreciated.
Thanks in advance,
Chris
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #12 by Annie Hunt <ajhunt@b...> on Tue, 21 May 2002 09:14:09 +0100
|
|
Hi Chris
I guess you probably already sorted this out by now (I couldn't get to the
end of the digest!)
but I thought I'd send you this in case you were still out there scratching.
I know you want to use vb but I use a bit of javascript to validate the
form,
I also use action = in the form tag to cause the asp to run itself again so
you get a couple
of bytes at it so to speak.
Anywho, it's a bit of a head banger at first but it works for me.
Annie
Save this as test.asp
<script language="JavaScript">
function IsValidForm(theForm) {
if (theForm.DisSubject.value == "") {
alert("Please enter a value for the \"Subject\" field.");
theForm.DisSubject.focus();
return(false);
}
if (theForm.DisSubject.value.length > 35) {
alert("Your title is too long maximum length is 35 characters.");
theForm.DisSubject.focus();
return(false);
}
theForm.ToDo.value = "NewPost"; //indicate 2nd pass
return(true);
}
</script>
<title>Test.asp</title>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<table align="center" border="1" cellpadding="1" cellspacing="0"
height="100%"width="100%">
<tr>
<td colspan="2" align="center">
New Message entered in discussion
</td></tr>
<% if request.form("ToDo") <> "NewPost" then 'first pass so present the
form%>
<form method="post" action="Test.asp" onSubmit="return IsValidForm(this)"
id="form1" name="form1">
<tr>
<td>Subject </td>
<td><input name="DisSubject" id="DisSubject" title="Input new or modify
subject" size="35"
</td>
</tr>
<tr>
<td>Body of message </td>
<td><textarea name="DisBody" id="DisBody" title="Input body of message to
post" rows="3" cols="70" wrap="hard"></textarea>
</td>
</tr>
<tr><td colspan="2">
<input type="SUBMIT" title="Post Message" value="Post Message"
name="Submit">
<input TYPE="HIDDEN" Value="NoChange" Name="ToDo">
</td>
</tr>
</form>
<script language=javascript>
window.document.form1.DisSubject.focus(); //26/4/2focus first form element
</script>
<% else '2nd pass so form has validated
%>Form has validated so do whatever is right here
<%end if %>
</table>
</body>
</html>
-----Original Message-----
From: ASP Web HowTo digest [mailto:asp_web_howto@p...]
Sent: 21 May 2002 00:01
To: asp_web_howto digest recipients
Subject: asp_web_howto digest: May 20, 2002
-----------------------------------------------
When replying to the digest, please quote only
relevant material, and edit the subject line to
reflect the message you are replying to.
-----------------------------------------------
----------------------------------------------------------------------
Subject: RE: VBScript Problem
From: "Chris Thompson" <cthompson@n...>
Date: Mon, 20 May 2002 13:34:11 -0600
X-Message-Number: 2
I know this is more VB script client side versus VBscript server side
(ASP), but can anyone help me here?
I have a form and want to test dome fields before I submit it. I have s
function that is called from the 'OnSUBMIT' parameter of the FORM tag.
It calls the function correctly, but I am trying to get it to stop the
form processing. Here is some of my code:
<SCRIPT LANGUAGE=3D'VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
CheckSubmit =3D false
End Function
</SCRIPT>
<FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'CheckSubmit()'>
...
</FORM>
Anyone have any ideas as to why the 'CheckSubmit =3D false' is not
working? I have also tried 'return false' in place of it, but that
gives me an error. When I hit the submit button, it shows the msgbos,
then forwards to the next page. I need it to stop. Any help would be
greaty appreciated.
Thanks in advance,
Chris
Message #13 by "phil griffiths" <pgtips@m...> on Tue, 21 May 2002 09:42:55
|
|
Hi Chris,
None of the methods that suggest return... will work. return is a js
thing, it means nothing to VBS. Using the returnValue property of the
event instead works for me, like this:
<SCRIPT LANGUAGE='VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
window.event.returnValue = False
End Function
</SCRIPT>
<FORM ACTION='processaddmain.asp' METHOD="POST" ONSUBMIT='CheckSubmit'>
...
</FORM>
HTH
Phil
-----------------------------------
> Those didn't work either.
-----Original Message-----
From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]
Sent: Monday, May 20, 2002 2:07 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
VBScript does not have datatypes. It does not know that
your CheckSubmit Function is supposed to be boolean.
Either try FALSE, all uppercase, or "false", in quotes.
> If I do it like this, I get a type mismatch error on return.
>
> <SCRIPT LANGUAGE=3D'VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> msgbox CheckSubmit
> CheckSubmit =3D false
> msgbox CheckSubmit
> End Function
> </SCRIPT>
>
> <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
> ONSUBMIT=3D'return:CheckSubmit()'>
>
>
>
>
> If I do it like this, The last msgbox says false, so the function is
> getting a false value. I can only assume it is not getting back then
> because it still submits
>
> <SCRIPT LANGUAGE=3D'VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> msgbox CheckSubmit
> CheckSubmit =3D false
> msgbox CheckSubmit
> End Function
> </SCRIPT>
>
> <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
ONSUBMIT=3D'CheckSubmit()'>
>
>
>
> -----Original Message-----
> From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]
> Sent: Monday, May 20, 2002 1:45 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>
> Try Return:CheckSubmit()...
>
> The problem is that you are not checking to see if the
> value being returned is True Or False. In your form, put
> in a hidden input field, with CheckSubmit() as your
> value, and see what value is being passed, true or false.
> > I get an error with this line:
> >
> >
> >
> >
> >
> > <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST ONSUBMIT=3D'return
> > CheckSubmit()'>
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Debreceni, David [mailto:david_debreceni@r...]
> > Sent: Monday, May 20, 2002 1:38 PM
> > To: ASP Web HowTo
> > Subject: [asp_web_howto] RE: VBScript Problem
> >
> >
> >
> > Try this ONSUBMIT=3D'return CheckSubmit()'
> > I think you have to have a return there.
> > Hope that helps
> >
> > David Debreceni
> > Senior Visual Basic/ASP Developer
> > xxx-xxx-xxxx x 1086
> >
> >
> >
> > -----Original Message-----
> > From: Chris Thompson [mailto:cthompson@n...]
> > Sent: Monday, May 20, 2002 3:34 PM
> > To: ASP Web HowTo
> > Subject: [asp_web_howto] RE: VBScript Problem
> >
> >
> >
> > I know this is more VB script client side versus VBscript server
side
> > (ASP), but can anyone help me here?
> >
> > I have a form and want to test dome fields before I submit it. I
have
> s
> >
> > function that is called from the 'OnSUBMIT' parameter of the FORM
tag.
>
> > It calls the function correctly, but I am trying to get it to stop
the
>
> > form processing. Here is some of my code:
> >
> > <SCRIPT LANGUAGE=3D'VBSCRIPT'>
> > Function CheckSubmit()
> > msgbox "HI"
> > CheckSubmit =3D false
> > End Function
> > </SCRIPT>
> >
> > <FORM ACTION=3D'processaddmain.asp' METHOD=3DPOST
> ONSUBMIT=3D'CheckSubmit()'>
> >
> > ...
> >
> > </FORM>
> >
> > Anyone have any ideas as to why the 'CheckSubmit =3D false' is not
> > working? I have also tried 'return false' in place of it, but that
> > gives me an error. When I hit the submit button, it shows the
msgbos,
>
> > then forwards to the next page. I need it to stop. Any help would
be
> > greaty appreciated.
> >
> > Thanks in advance,
> >
> > Chris
Message #14 by "Chris Thompson" <cthompson@n...> on Tue, 21 May 2002 13:12:49 -0600
|
|
This one worked. Thanks for the help. Thanks to all of those out there
who send in comments to help. I appreciate the willingness to help.
Chris
-----Original Message-----
From: phil griffiths [mailto:pgtips@m...]
Sent: Tuesday, May 21, 2002 3:43 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
Hi Chris,
None of the methods that suggest return... will work. return is a js
thing, it means nothing to VBS. Using the returnValue property of the
event instead works for me, like this:
<SCRIPT LANGUAGE=3D'VBSCRIPT'>
Function CheckSubmit()
msgbox "HI"
window.event.returnValue =3D False
End Function
</SCRIPT>
<FORM ACTION=3D'processaddmain.asp' METHOD=3D"POST"
ONSUBMIT=3D'CheckSubmit'>
...
</FORM>
HTH
Phil
-----------------------------------
> Those didn't work either.
-----Original Message-----
From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]=3D20
Sent: Monday, May 20, 2002 2:07 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: VBScript Problem
VBScript does not have datatypes. It does not know that=3D20
your CheckSubmit Function is supposed to be boolean.=3D20
Either try FALSE, all uppercase, or "false", in quotes.
> If I do it like this, I get a type mismatch error on return.
>=3D20
> <SCRIPT LANGUAGE=3D3D'VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> msgbox CheckSubmit
> CheckSubmit =3D3D false
> msgbox CheckSubmit
> End Function
> </SCRIPT>
>=3D20
> <FORM ACTION=3D3D'processaddmain.asp' METHOD=3D3DPOST
> ONSUBMIT=3D3D'return:CheckSubmit()'>
>=3D20
>=3D20
>=3D20
>=3D20
> If I do it like this, The last msgbox says false, so the function is
> getting a false value. I can only assume it is not getting back then
> because it still submits
>=3D20
> <SCRIPT LANGUAGE=3D3D'VBSCRIPT'>
> Function CheckSubmit()
> msgbox "HI"
> msgbox CheckSubmit
> CheckSubmit =3D3D false
> msgbox CheckSubmit
> End Function
> </SCRIPT>
>=3D20
> <FORM ACTION=3D3D'processaddmain.asp' METHOD=3D3DPOST
ONSUBMIT=3D3D'CheckSubmit()'>
>=3D20
>=3D20
>=3D20
> -----Original Message-----
> From: jstmehr4u3@a... [mailto:jstmehr4u3@a...]=3D20
> Sent: Monday, May 20, 2002 1:45 PM
> To: ASP Web HowTo
> Subject: [asp_web_howto] RE: VBScript Problem
>=3D20
> Try Return:CheckSubmit()...
>=3D20
> The problem is that you are not checking to see if the=3D20
> value being returned is True Or False. In your form, put=3D20
> in a hidden input field, with CheckSubmit() as your=3D20
> value, and see what value is being passed, true or false.
> > I get an error with this line:
> >=3D20
> > =3D20
> >=3D20
> > =3D20
> >=3D20
> > <FORM ACTION=3D3D'processaddmain.asp' METHOD=3D3DPOST
ONSUBMIT=3D3D'return
> > CheckSubmit()'>=3D20
> >=3D20
> > =3D20
> >=3D20
> > =3D20
> >=3D20
> > -----Original Message-----
> > From: Debreceni, David [mailto:david_debreceni@r...]=3D20
> > Sent: Monday, May 20, 2002 1:38 PM
> > To: ASP Web HowTo
> > Subject: [asp_web_howto] RE: VBScript Problem
> >=3D20
> > =3D20
> >=3D20
> > Try this ONSUBMIT=3D3D'return CheckSubmit()'=3D20
> > I think you have to have a return there.=3D20
> > Hope that helps=3D20
> >=3D20
> > David Debreceni=3D20
> > Senior Visual Basic/ASP Developer=3D20
> > xxx-xxx-xxxx x 1086=3D20
> >=3D20
> > =3D20
> >=3D20
> > -----Original Message-----=3D20
> > From: Chris Thompson [mailto:cthompson@n...]=3D20
> > Sent: Monday, May 20, 2002 3:34 PM=3D20
> > To: ASP Web HowTo=3D20
> > Subject: [asp_web_howto] RE: VBScript Problem=3D20
> >=3D20
> > =3D20
> >=3D20
> > I know this is more VB script client side versus VBscript server
side=3D20
> > (ASP), but can anyone help me here?=3D20
> >=3D20
> > I have a form and want to test dome fields before I submit it. I
have
> s
> >=3D20
> > function that is called from the 'OnSUBMIT' parameter of the FORM
tag.
>=3D20
> > It calls the function correctly, but I am trying to get it to stop
the
>=3D20
> > form processing. Here is some of my code:=3D20
> >=3D20
> > <SCRIPT LANGUAGE=3D3D'VBSCRIPT'>=3D20
> > Function CheckSubmit()=3D20
> > msgbox "HI"=3D20
> > CheckSubmit =3D3D false=3D20
> > End Function=3D20
> > </SCRIPT>=3D20
> >=3D20
> > <FORM ACTION=3D3D'processaddmain.asp' METHOD=3D3DPOST
> ONSUBMIT=3D3D'CheckSubmit()'>=3D20
> >=3D20
> > ...=3D20
> >=3D20
> > </FORM>=3D20
> >=3D20
> > Anyone have any ideas as to why the 'CheckSubmit =3D3D false' is
not=3D20
> > working? I have also tried 'return false' in place of it, but
that=3D20
> > gives me an error. When I hit the submit button, it shows the
msgbos,
>=3D20
> > then forwards to the next page. I need it to stop. Any help would
be=3D20
> > greaty appreciated.=3D20
> >=3D20
> > Thanks in advance,=3D20
> >=3D20
> > Chris=3D20
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
|
|
 |