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!

input text type turns into list box and shows prior data vals

Status
Not open for further replies.

fiddler2

Programmer
Apr 21, 2008
2
US
Hello,
I've posted this in Utter Access, but didn't get a response, so I'm hoping for some help here. I've been at this problem for hours and am hoping there is a simple fix. I'm using MS Access 2003 and IIS v6.

I'm new to ASP, but I coded with html and asp against MS Access to allow the user to do data entry. Problem is, when I populate the text boxes, nothing shows in them. However, if I double-click, they turn into list boxes and show everything I tried to fill them with during the entire session (going back and forth testing). They also show my login ID. It's freaky! Following is a snippet of code. Can you tell me what might be wrong with it to cause this reaction? I might add that prior to this piece of code, I had built two drop-down boxes that fill correctly, except they don't list the default as they should.
.....snipped
Code:
<td><input type="text" name ="DonorBusName" value = "<%=DonorBusName%>"/><%=DonorBusName%></td>

<td><input type="text" name="DonorEmail" value = "<%=DonorEmail%>"/><%=DonorEmail%></td>

<td><input type="text" name="DonorWebsite" value = "<%=DonorWebsite%>"/><%=DonorWebsite%></td>
</tr>
 

Hi and welcome to Tek-Tips. To get the best from these forums please read faq222-2244 carefully.

For this question:
Problem is, when I populate the text boxes, nothing shows in them.
can you show the relevant section of code for this - you only mention input controls in your code.

May be best to show the whole page, as it appears to contain javascript as well.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
I would only put my variable name in the value=<%=variablename%> and I would change the field names to something different.
 
Hi,
Thanks for the response. I really appreicate it. I wasn't sure to call these things "text boxes" as I don't think they literally are, but ok, if that's the syntax. Anyway, I appreciate the response. I got the data to pop up in the fields, except the two combo boxes (drop down boxes?) are not yet showing the default. Also, when I double-click on the "text boxes" some of them still show multiple values and others don't seem to respond that way.

Following is my code. Please bear in mind I've never written ASP (or any of this except VBA) before this project, so this may be a bit of a mess. Also, I've been testing with this:

Code:
<%@ Language=VBScript %>
<!--#include file="includes.asp"-->
<HTML>
<HEAD><TITLE>Add/Edit Donor</TITLE>
<LINK REL="StyleSheet" HREF="css/default.css" TYPE="text/css" MEDIA="all">
<% Response.Expires = 0 %> 
</head>
<div class="center">
<BODY link="black" alink="red" vlink="lightblue" topmargin = "10%" bgcolor="lightblue" FONT="SANSERIF"><h1 >Donors</h1>
<%
dim strSql
dim strSql2
dim rsVols
dim passdonorid
dim strAddEdit
Dim rs
Dim DonorBusName
dim VolunteerID
dim VolFName
dim VolLName
Dim DonorType
Dim DonorSubType
Dim DonorEmail
Dim DonorWebsite
Dim DonorDept
Dim DonorAddress
Dim DonorAddress2
Dim DonorCity
Dim DonorState
Dim DonorZip
Dim DonorPhone
Dim DonorPhone2
Dim DonorFAX
Dim StartedYear
Dim Active
Dim FID
Dim DonorNotes
dim strtype

dim strsubtype
dim strVolID
dim strVolFName
dim strVolLName
dim strTaxYear
dim rs3
dim strSql3
intdonor=request.querystring("donorid")

	strSql="Select * from tdonors WHERE fldDonorID = " & intdonor & ";"
	
 Set Conn = Server.CreateObject("ADODB.Connection")
	  Conn.Open ConString
	  Set rs = Server.CreateObject("ADODB.Recordset")
	  rs.Open strSql, Conn

if not rs.eof then
VolunteerID= rs("fldVolunteerID")
 DonorBusName = rs.fields("fldDonorBusName") 
 VolID   = rs.fields("fldVolunteerID")
 DonorType  = rs.fields("fldDonorType") 
 DonorSubType= rs("fldDonorSubType")
 
 DonorEmail  = rs.fields("fldDonorEmail") 
 DonorWebsite  = rs.fields("fldDonorWebsite") 
 DonorDept  = rs.fields("fldDonorDept") 
 DonorAddress  = rs.fields("fldDonorAddress") 
 DonorAddress2  = rs.fields("fldDonorAddress2") 
 DonorCity  = rs.fields("fldDonorCity") 
 DonorState  = rs.fields("fldDonorState") 
 DonorZip  = rs.fields("fldDonorZip") 
 DonorPhone  = rs.fields("fldDonorPhone") 
 DonorPhone2  = rs.fields("fldDonorPhone2") 
 DonorFAX  = rs.fields("fldDonorFAX") 
 strTaxYear = rs.fields("fldActiveYear") 
Active  = rs.fields("fldActive") 
 FID  = rs.fields("fldfid") 
 DonorNotes  = rs.fields("fldDonorNotes") 
 
 else
 response.write "bozo" & intdonor
end if

%>


<p><font color="blue"> <a href="getdonors.asp?userID=<%=intUserID%>">Return to Donors Menu</a></font></br></p>

<a href="webmainmenu.asp?userID=<%=intUserID%>">Return to Main Menu</a>


<form action="testeditdonor.asp" method="post" >
 
<table>
<tr>
	<th>Donor ID </th>
	<th> Donor Type</th>
	<th> Volunteer</th>
	<th> Business Name</th>
	<th> Donor Email</th><p>
	<th> Website</th><p>
</tr>

	<tr>
		<td><%=intdonor%></td>
		
		<%strSql3="Select * from webdonortypeandsub"
		<!--Set Conn = Server.CreateObject("ADODB.Connection")-->
		<!--Conn.Open ConString-->
		Set rs3 = Server.CreateObject("ADODB.Recordset")
		rs3.Open strSql3, Conn
		
		if not rs3.eof then %>
		
		<td>
					<font size ="8pt">
		<select style =width:"150px";name="Types_Subtypes" >
			
			<%
			rs3.movefirst
	end if
		do while not rs3.eof
			strType = rs3("fldDonorType")
			strSubtype = rs3("fldDonorTypeSub")
			
			IF donortype = strType and donorSubtype = strsubtype then%>
				
				<option value=<%=strType%>><% =strType%>__<% =strSubtype %>SELECTED</option>
				<%else%>
				<option value=<% =strType%>><% =strType%>__<% =strSubtype %></option>
				
				<%end if
				
				
				rs3.movenext
		loop	
		rs3.Close
			set rs3 = Nothing%>
					
		</font>
	</td>
			</select>
	
		<%strSql2="Select * from LU_tVolunteers WHERE fldActive = -1 ORDER BY fldVolFirstName"
				<!--Set Conn = Server.CreateObject("ADODB.Connection")-->
		<!--Conn.Open ConString-->
		Set rsVols = Server.CreateObject("ADODB.Recordset")
		rsVols.Open strSql2, Conn
		
		%>
		<td>
			<font size ="8pt"><select style =width:"150px";name="Volunteers" >
		<%
			rsVols.movefirst
		
		do while not rsVols.eof
			strVolID = rsVols("fldVolunteerID")
			strVolFName = rsVols("fldVolFirstName")
			strVolLName = rsVols("fldVolLastName")
			
			if strVolID = VolunteerID then%>
			<option value=<% =strVolID%>><% =strVolID%>__<% =strVolFName%>_<% =strVolLName%>SELECTED</option>
			
			<%ELSE%>
			
			<option value=<% =strVolID%>><% =strVolID%>__<% =strVolFName%>_<% =strVolLName%> </option>
		
		<%END IF
			rsVols.movenext
		loop%> 
				
		</font></td></select>
			
			
		<td><input type="text" name ="DonorBusName" value = "<%=DonorBusName%>"/></td>
		<td><input type="text" name="DonorEmail" value = "<%=DonorEmail%>"/></td>
		<td><input type="text" name="DonorWebsite" value = "<%=DonorWebsite%>"/></td>
	</tr>
	
<tr>

	<th> Phone</th>
	<th> Phone2</th>
	<th> FAX</th>

</tr>
<tr>
		<td><input type="text" name="DonorPhone" value = "<%=DonorPhone%>"/></td>
		<td><input type="text" name="DonorPhone2" value = "<%=DonorPhone2%>"/></td>	
		<td><input type="text" name="DonorFAX" value = "<%=DonorFAX%>"/></td>

</tr>
<tr>

<th> Dept</th>
<th> Address</th>
<th> Address2</th>
<th> City</th>
<th> State</th>
<th> Zip</th>
</tr>
<tr>
		<td><input type="text" name="DonorDept" value = "<%=DonorDept%>"/></td>
		<td><input type="text" name="DonorAddress" value = "<%=DonorAddress%>"/></td>
		<td><input type="text" name="DonorAddress2" value = "<%=DonorAddress2%>"/></td>
		<td><input type="text" name="DonorCity" value = "<%=DonorCity%>"/></td>
		<td><input type="text" name="DonorState" value = "<%=DonorState%>"/></td>
		<td><input type="text" name="DonorZip" value = "<%=DonorZip%>"/></td>

</tr>

<tr>
<th> Tax Year</th>
<th> Started Year</th>
<th> Active?</th>
<th> FID</th>
</tr>

<tr>
		<td><input type="text" name="strTaxYear" value = "<%=strTaxYear%>"/></td>
		<td><input type="text" name="StartedYear" value = "<%=StartedYear%>"/></td>
		<td><input type="checkbox" name="Active" value="<%=Active%>"/></td>
		<td><input type="text" name="FID" value ="<%=FID%>"/></td>
</tr>
<tr>
<th width="400px"> Notes</th>	
</tr>
<div width="400px">
<tr width="400px" >
<td width="400px" style="word-wrap: break-word;"><input type="text" name="DonorNotes" value="<%=DonorNotes%>"/></td>

	</tr>
	</div>
<tr>
	
		<input type="hidden" name="passdonorid"value = "<% =intdonor%>">
	<input type="hidden" name="DonorType"value = "<% =strType%>">
	<input type="hidden" name="DonorSubType"value = "<% =strSubtype%>">	
</tr>
<input type="hidden" name="volid"value = "<% =strvolid%>">
<input class = "btncenter" type="submit" name = "EditDonor" value = "Update Record" bgcolor="darkblue" >

</form>
</div>
<%rsVols.Close
set rsVols = Nothing%>
	

</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top