Re: Error Object doesn't support this property or method

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi,

"Mike L" <Cadel@xxxxxxxxxxxxx> wrote in message
news:717A724D-068F-4F37-A9BE-22165D1EFF4B@xxxxxxxxxxxxxxxx
>
> When I click on the submit button I get the error message, "Object doesn't
> support this property or method". I want a Yes No Message Box to pop up
> on
> click of the submit button. If the user clicks on NO then cancel submit if
> user clicks on YES then continue submit.
>
> <html>
> <head>
>
> <title>test</title>
> <script type="text/vbscript">
> Function MakeMsgBox()
> if MsgBox("Test",vbyesno,"Legacy Permit") then
> MakeMsgBox = True
> else
> MakeMsgBox = False
> End if
> End Function
> </script>
> </head>
>
> <body>
> <form name="OnlineSales2" action="OnlineSales3.asp" method="post"
> onSubmit="MakeMsgBox">
>
> <input type="submit" value="Continue">
>
> </form>
> </body>
> </html>
>

This is not a script issue. Your script works fine as local client-side
html (see below). Check your form submit.

-----
<html>
<head>

<title>test</title>
<script type="text/vbscript">
Function MakeMsgBox()
if MsgBox("Test",vbyesno,"Legacy Permit") then
MakeMsgBox = True
else
MakeMsgBox = False
End if
End Function
</script>
</head>

<body>
<button onClick="makeMsgBox">Test Button</button>
</body>
</html>
-----

BTW, you can shorten

> if MsgBox("Test",vbyesno,"Legacy Permit") then
> MakeMsgBox = True
> else
> MakeMsgBox = False
> End if

to

MakeMsgBox = _
(MsgBox("Test",vbyesno,"Legacy Permit")=vbYes)


Joe Earnest


.


Quantcast