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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acivate command button by clicking another command button

Status
Not open for further replies.

Charlix

Programmer
Nov 19, 2002
85
US
Could anyone tell me how to activate a given command-button by clicking another one on an ASP page.

I tried the following three snippets without success.

<SCRIPT LANGUAGE="VBScript">
Sub Command1_onClick()
Command2.onClick = True
End Sub
</Script>

<SCRIPT LANGUAGE="VBScript">
Sub Command1_onClick()
Command2.value = True
End Sub
</Script>

<SCRIPT LANGUAGE="VBScript">
Sub Command1_onClick()
Command2.onClick
End Sub
</Script>

Thanks
 
I guess it will be easier to write a function in JavaScript that will activate or deactivate a button, or show or hide it. Then you call the function in onClick event written for the first submit button.
 
Thanks Ankor,
That's what I'm trying to do, is to write a function in VBScript that will activate the command2 button to process some code when command1 is clicked.

I just don't seem to be able to do it.

Charlix
 
How about Command2.enabled = True ?
Or it my be the other way, can never remember: Command2.disabled = false

-T


01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
The never-completed website:
 
you could try this:
Code:
<html>
	<script language="javascript">
	function check()
	{
		var currId = div1.id;
		document.getElementById(currId).style.visibility= "visible";
		alert(document.getElementById(currId).style.visibility);
	}
	</script>
	<body >
		<form method="post" name="test">
			<br><br>
			<input type=button onclick="check();" value="command1">
			<br><br>
			<div id="div1" style="visibility:hidden;">
			<input value="Command2" type=button ID="Button1" NAME="Button1">
			</div>
		</form>
		
	</body>
</html>

Hope this helps.
rsshetty.


It's always in the details.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top