View Single Post
  #1 (permalink)  
Old November 10th, 2003, 05:19 PM
rylemer rylemer is offline
Authorized User
 
Join Date: Jun 2003
Location: Marikina, , Philippines.
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default Update textbox when List menu is Selected

Hi!
I have a list menu. then I pull the records in one of my table I created I called tblAssign there are 3 Columns in my table. ID, Assign and Email.
What I would like to do is When I selected the records in the list menu the textbox will be updated for ex. when I select "ELmer" in the list Menu the textbox will be shown my email adddres.

here is my codes hope you can help me thanks!!


<%Response.buffer=true%>
<%
  Set ObjCommand = Server.CreateObject("ADODB.Command")
  Set ObjCommand.ActiveConnection = ObjConn
      strSQLAssign= "SELECT assign,email from tblAssign Order by assign ASC;"
      ObjCommand.CommandText = strSQLAssign
  Set objRSt = ObjCommand.Execute
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script language="javascript">
    function PutEmail(objThis){
        document.form1.txtEmail.value = document.form1.assign.sourceIndex(2);
    }
</script>
<body>
<form name="form1" method="post" action="">
  <select name="assign" size="1" OnChange=PutEmail(this);>
          <option><%=strassigned%></option>
          <%
               While not objRSt.EOF
                Response.Write "<option " & objRSt("email") & ">" & objRSt("assign") & "</option>" & "<br>"
                objRSt.MoveNext
            Wend
                objRSt.Close
             set objRSt = Nothing
          %>
   </select>
  <input name="txtEmail" type="text" id="txtEmail">
  <input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
Reply With Quote