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

change submit button text on-the-fly - Can it be done?

Status
Not open for further replies.

SPrelewicz

Programmer
Jul 16, 2001
124
US
Is there a way, when another button is clicked, to automatically change the text (value parameter?) of a different submit button?
 
here is a solution:
Code:
<html>
<head>
<script>
		function changeSomeOne(){
			document.myForm.button2.value = &quot;Something Else&quot;;
			return true;
		
		}//end function
	</script>
</head>

<body>
<form name=&quot;myForm&quot;>

<input type=&quot;button&quot; name=&quot;button1&quot; value=&quot;Hello&quot; onClick=&quot;changeSomeOne()&quot;><input type=&quot;button&quot; name=&quot;button2&quot; value=&quot;Goodbye&quot;></form>
</body>
</html>
 
Thank you for your reply. Does the second button have to be of type button, or can it be of type submit?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top