Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Javascript:return vbscript equivalent

Reply
Thread Tools

Javascript:return vbscript equivalent

 
 
Jim Ciotuszynski
Guest
Posts: n/a
 
      07-06-2004
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


 
Reply With Quote
 
 
 
 
Trevor Benedict R
Guest
Posts: n/a
 
      07-06-2004
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!
 
Reply With Quote
 
 
 
 
Jim Ciotuszynski
Guest
Posts: n/a
 
      07-06-2004
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" <(E-Mail Removed)> wrote in message news:%(E-Mail Removed)...
> 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!

 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      07-06-2004
"Jim Ciotuszynski" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
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


 
Reply With Quote
 
Jim Ciotuszynski
Guest
Posts: n/a
 
      07-06-2004
Tried it, the event still fires regardless of what the return value is.

Jim
"John Saunders" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
"Jim Ciotuszynski" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
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


 
Reply With Quote
 
Trevor Benedict R
Guest
Posts: n/a
 
      07-06-2004
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!
 
Reply With Quote
 
Jim Ciotuszynski
Guest
Posts: n/a
 
      07-06-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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!



 
Reply With Quote
 
nescafe nescafe is offline
Junior Member
Join Date: Sep 2011
Posts: 1
 
      09-15-2011
Found this thread with no answer; you can use the statement 'window.event.returnValue = True/False' for this
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript equivalent for vbscript Date()-1 shelleybobelly Javascript 18 03-30-2007 10:46 PM
What is an equivalent TimeSerial() function of VBscript in the Java Script?? divya Javascript 7 09-25-2006 05:14 AM
Javascript equivalent for VBScript polychrom@softhome.net Javascript 3 05-25-2006 07:53 PM
whats the equivalent of vbcrlf,vbcr,vblf (vbscript) in c#.net sundar_s1210 ASP .Net 4 05-09-2005 04:54 PM
VBScript to generate strong WPA pre shared keys? Wireless Networking 1 11-15-2004 10:30 PM



Advertisments