How to disabled and enabled button in VBScript

No.of Views4070
Bookmarked0 times
Downloads 
Votes0
By  dotnetfish   On  10 Nov 2010 10:11:22
Tag : VBScript , How to
In this snippet, i will show you,How to disabled and enabled button in VBScript
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

In this snippet, i will show you,How to disabled and enabled button in VBScript. now days javascript is famous than VbScript. but some scenario still VB script is important to use in client side code.Here i have compose code for the disable and enable button using vbscript.this is very simple and easy.

Script

<html>
<head>
    <title>VBScript Example: disabled and enabled button</title>

    <script language="VBScript">
sub enableButton()
if frm.chkbox_1.checked = true then
frm.btn_1.disabled = false
else
frm.btn_1.disabled = true
end if

end sub
    </script>

</head>
<body>
    <form name="frm">
    <input type="checkbox" name="chkbox_1" value="ON" onclick="enableButton()"></input>
    <input type="submit" value="I Agree" name="btn_1" disabled></input>
    </form>
</body>
</html>

In above code , vbscript is only

<script language="VBScript">
sub enableButton()
if frm.chkbox_1.checked = true then
frm.btn_1.disabled = false
else
frm.btn_1.disabled = true
end if

end sub
    </script>

when i click check, I'm try to enable or disable button.i hope this is help to all.

 
Sign Up to vote for this article
 
About Author
 
dotnetfish
Occupation-
Company-
Member Type-Senior
Location-United States
Joined date-05 Sep 2010
Home Page-
Blog Page-dotnetfish.blogspot.com
 
 
Other popularSectionarticles
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top
</