Hi

Hi have the code below. When I run the javascript that I have comment it works, but when I try to run the vbscript, nothing happens. I just wounder what I have done wrong

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
   <%-- <script language ="javascript"  type="text/javascript"  >--%>

	<script type="text/vbscript">
  
    sub Click()
		  document.getElementById("txtDown").value=  document.getElementById("txtUp").value
    end sub
	
'	function Click() 
'	{		 document.getElementById("txtDown").value=  document.getElementById("txtUp").value;
'            /*set txt1 = document.getElementById("txtUp") 
'            set txt2 = document.getElementById("txtDown") 
'            txt2.innertext = txt1.innertext*/
'     }   
      

	</script>
</head>
<body>

	
    <form id="form1" runat="server">
    <div>
		<img src="Images/text.GIF" />
		<br />
		<br />
		<input type="text"  id="txtUp"/>
		<br />
		<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="btn" onclick ="Click()" /> Read</button>
		<br />
		<br />
		<input type="text" id="txtDown" />
    </div>
    </form>
</body>
</html>

Thanks
Fia

IE only.

<head runat="server">
    <title></title>
    <script type="text/vbscript">
     sub aaa ()
          
		   document.getElementById("txtDown").value=  document.getElementById("txtUp").value
     end sub
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <input type="text"  id="txtUp"/>
		<br />
		<br />
		  <button id="btn" onclick ="aaa()" type="button" /> Read</button>
		<br />
		<br />
		<input type="text" id="txtDown" />
    </div>
    </form>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.