Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enable Button On Click Of A Button

Status
Not open for further replies.

Sneapy

Technical User
Nov 1, 2012
14
GB
Hey

I'd like to enable disabled buttons using vbscript on the click of another button.

so i have 6 buttons disabled and on the click of a start button i would like to activate the buttons.
please help and keep it simple :D
 
crude (vbs will only work with IE, use java otherwise)

Code:
<html>
	
<script language="vbscript">
	sub enableButtons()
		set objButtons = document.getElementsByTagName("button")
		for x = 0 to objButtons.length - 1
			if (objButtons(x).disabled) then objButtons(x).removeAttribute("disabled")
		next
         end sub
</script>

	<body>
		<button name="start" onClick="enableButtons()">start</button>
		<button name="button1" disabled>1</button>
		<button name="button2" disabled>2</button>
		<button name="button3" disabled>3</button>
		<button name="button4" disabled>4</button>
		<button name="button5" disabled>5</button>
		<button name="button6" disabled>6</button>
	</body>
</html>

-Geates

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top