473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Javascript:return vbscript equivalent

Is there an equivalent to the
"button.attributes.add("onBlur","javascript:re turn somfunction();") ? I
thought that vbscrpt would also do the same but when I run my code with the
vbscript my button click event gets fired no matter if the vbscript returns
false or true? Any help would be great.

Thanks,
Jim
Nov 18 '05 #1
10 2279
See if this code helps. All you have to do is structure your client side
script.

<html>
<body>
<button OnClick="Click1()">Click Me</button>
</body>
<script Language="VBScript">
Function Click1()
IF FuncYes Then
Msgbox "Returns True"
Else
Msgbox "Returns False"
End If
If FuncNo Then
Msgbox "Returns True"
Else
Msgbox "Returns False"
End If
End Function
Function FuncYes()
FuncYes = True
End Function
Function FuncNo()
FuncNo = False
End Function

</script>
</html>

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #2
OK, this is what I have for my testing purposes:
ASP.net project with a button and a checkbox on it. in the code behind form load I have:
Button1.Attributes.Add("onclick", "vbscript:confirm_delete()")

Here is the vbscript code:

Function validMe()
if form1.CheckBox1.Checked = False then
validMe = False
Else
validMe= True
End if
End Function

What I would like to happen is the button1_click event in the code behind page not to fire if the return is FALSE. I can get it to work in JavaScript just fine, I need to get it to work in Vbscript.

Thanks,
Jim

"Trevor Benedict R" <tr********@yahoo.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
See if this code helps. All you have to do is structure your client side
script.

<html>
<body>
<button OnClick="Click1()">Click Me</button>
</body>
<script Language="VBScript">
Function Click1()
IF FuncYes Then
Msgbox "Returns True"
Else
Msgbox "Returns False"
End If
If FuncNo Then
Msgbox "Returns True"
Else
Msgbox "Returns False"
End If
End Function
Function FuncYes()
FuncYes = True
End Function
Function FuncNo()
FuncNo = False
End Function

</script>
</html>

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #3
"Jim Ciotuszynski" <ji****@hotmail.com> wrote in message news:uc**************@TK2MSFTNGP11.phx.gbl...
OK, this is what I have for my testing purposes:
ASP.net project with a button and a checkbox on it. in the code behind form load I have:
Button1.Attributes.Add("onclick", "vbscript:confirm_delete()")

Try it without the "vbscript:". I believe you only want that on the href of an anchor tag.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #4
Tried it, the event still fires regardless of what the return value is.

Jim
"John Saunders" <jo**************@notcoldmail.com> wrote in message news:Om**************@TK2MSFTNGP09.phx.gbl...
"Jim Ciotuszynski" <ji****@hotmail.com> wrote in message news:uc**************@TK2MSFTNGP11.phx.gbl...
OK, this is what I have for my testing purposes:
ASP.net project with a button and a checkbox on it. in the code behind form load I have:
Button1.Attributes.Add("onclick", "vbscript:confirm_delete()")

Try it without the "vbscript:". I believe you only want that on the href of an anchor tag.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #5
OK, this is what I have for my testing purposes:
ASP.net project with a button and a checkbox on it. in the code behind form load I have:
Button1.Attributes.Add("onclick", "vbscript:confirm_delete()")

Here is the vbscript code:

Function validMe()
if form1.CheckBox1.Checked = False then
validMe = False
Else
validMe= True
End if
End Function

What I would like to happen is the button1_click event in the code behind page not to fire if the return is FALSE. I can get it to work in JavaScript just fine, I need to get it to work in Vbscript.

Thanks,
Jim

"Trevor Benedict R" <tr********@yahoo.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
See if this code helps. All you have to do is structure your client side
script.

<html>
<body>
<button OnClick="Click1()">Click Me</button>
</body>
<script Language="VBScript">
Function Click1()
IF FuncYes Then
Msgbox "Returns True"
Else
Msgbox "Returns False"
End If
If FuncNo Then
Msgbox "Returns True"
Else
Msgbox "Returns False"
End If
End Function
Function FuncYes()
FuncYes = True
End Function
Function FuncNo()
FuncNo = False
End Function

</script>
</html>

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #6
Why not write your core function in VBScript and then call it from a
JavaScript function with the return keyword. I am sorry to put you on a
wild goose chase. This computer that I am sitting on is a WIN98 box with
none of my stuff to test anything for you.

Regards

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #7
"Jim Ciotuszynski" <ji****@hotmail.com> wrote in message news:uc**************@TK2MSFTNGP11.phx.gbl...
OK, this is what I have for my testing purposes:
ASP.net project with a button and a checkbox on it. in the code behind form load I have:
Button1.Attributes.Add("onclick", "vbscript:confirm_delete()")

Try it without the "vbscript:". I believe you only want that on the href of an anchor tag.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #8
Tried it, the event still fires regardless of what the return value is.

Jim
"John Saunders" <jo**************@notcoldmail.com> wrote in message news:Om**************@TK2MSFTNGP09.phx.gbl...
"Jim Ciotuszynski" <ji****@hotmail.com> wrote in message news:uc**************@TK2MSFTNGP11.phx.gbl...
OK, this is what I have for my testing purposes:
ASP.net project with a button and a checkbox on it. in the code behind form load I have:
Button1.Attributes.Add("onclick", "vbscript:confirm_delete()")

Try it without the "vbscript:". I believe you only want that on the href of an anchor tag.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #9
Why not write your core function in VBScript and then call it from a
JavaScript function with the return keyword. I am sorry to put you on a
wild goose chase. This computer that I am sitting on is a WIN98 box with
none of my stuff to test anything for you.

Regards

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #10
Well it looks like I'll have to bite the bullet and start writing my code in
Javascript, it's just that I know VB very well (been using since vb for DOS.
think I still have the software somewhere) and it's just a lot quicker for
my development needs. Thanks for everyone's help.

Jim Ciotuszynski
CTO/CIO eMedsoft.com Inc.

"Trevor Benedict R" <tr********@yahoo.com> wrote in message
news:Ob**************@TK2MSFTNGP09.phx.gbl...
Why not write your core function in VBScript and then call it from a
JavaScript function with the return keyword. I am sorry to put you on a
wild goose chase. This computer that I am sitting on is a WIN98 box with
none of my stuff to test anything for you.

Regards

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Weston C | last post by:
I know of course that you can use <script src=""></script> in an HTML document to include javascript code you don't want to spill all over the page. I'm wondering if there's a way to include...
3
by: effendi | last post by:
Hi Can any tell me what is the javascript equivalent of CSS border? I would like to change the border of my cell when it is set on focus. I have tried onFocus="style.border='3px'" but it is not...
3
by: jayanth.vishnuvardhan | last post by:
Hi All, Can any one help me on how to read & write the local machines registry values through scripting language. (vbscript/javscript)? I tried with Wscript.Shell Command & but with this we...
0
by: GirishKumar | last post by:
Am interested to know any available parsers for ASP / JavaScript / VBScript... OR any site info giving grammar of these... -- Girish Kumar Satyam
2
by: Kathy Burke | last post by:
I'm trying to use the following code to use a javascript return confirm. Cancel would exit the sub and return the page to its history (-2). OK would proceed with the asp.net code, i.e., run the...
4
by: phil | last post by:
Is there an elegant way that I can return a value from a JavaScript function to ASP.NET? I want to have a popup confirmation dialog using JavaScript and only have a button control execute its ASP...
2
by: Eitan | last post by:
Helo, I need to link the aspx page to a general vbscript (run on the server side). The code has the line : <%@ page language="vb" autowventWireUp="false" codeBehind="myasp.aspx.vb" inherits...
1
by: SmoKingGun | last post by:
Hi, I play this online MMORPG game called outwar and when I want to check my backpack on that game you need to open a little bar and when I click on "Orbs" thats one out of 5 tabs my Opra...
4
by: pghantasala | last post by:
How to get available physical memory using javascript NOT USING WMI ?? any other way? I need to achieve this by using javascript/vbscript and I cannot use WMI. Please let me know the possibilities.
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.