RSS Forums RSS
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Accessing Non-form Variables

Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 108
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: Accessing Non-form Variables

  #2  
Apr 24th, 2006
For reasons that are beyond my understanding, we are being moved into the whole new era of having to give things ID's. If someone knows another way, simplier, using names, please let me know, but try this:
<html>
<head>
	<meta http-equiv="Content-Type"content="text/html; charset=windows-1254">
	<title>JavaScript</title>
	<script language="javascript">
	function ShowValue()
	{
		document.getElementById("TextBox").value = "You clicked the button."; 	

	}
	</script>
</head>
<body bgcolor="#000000" text="#ffffff" vlink="#99FF33" link="#FF99FF">


<input type="text" ID="TextBox" name="TextBox" width="128"><br>
<input type="button" name="Show" value="Show" onClick="ShowValue();">

</body>
</html>
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:20 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC