IntroductionIn 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. |