|
| |
|
|
KCIWebMaster
Posts: 524 From: Fredericksburg VA USA Status: offline
|
Database record not displaying correctly - 11/8/2005 9:30:22
I have a simple table within a database with about 7 fields. I display the records in a table, with links for each record where the user can choose to edit the record. My problem is that when I go to a specific record to edit it, those fields that have more than one word in them do not display correctly. For example, instead of "John Smith" as the contact it only displays "John". If I look at the actual database, the information is stored correctly. I can't figure out why this is so. Here is the code for the table showing all records: <table border="0" width="880">
<tr>
<td bgcolor="#FFCC00" width="137" align="left">Description</td>
<td bgcolor="#FFCC00" width="116" align="left">Abbreviation</td>
<td bgcolor="#FFCC00" width="86" align="left">Business Area</td>
<td bgcolor="#FFCC00" width="88" align="left">Sales Office</td>
<td bgcolor="#FFCC00" width="140" align="left">Contact</td>
<td bgcolor="#FFCC00" width="146" align="left">Contact Phone Number</td>
<td bgcolor="#FFCC00" width="123" align="left">District</td>
</tr>
<%
Dim x, bgcolor
On Error Resume Next
Equipment.MoveFirst
do while Not Equipment.eof
%>
<tr <%
if x = 1 then
response.write "bgcolor='silver'"
x=2
Else
Response.write "bgcolor='white'"
x=1
End if %>
>
<td width="137" ><a href="edit_location.asp?LID=<%=Equipment("LID")%>&Operation=EDIT"><%=Equipment("Description")%></a>
</td>
<td width="116" ><%=Equipment("Abbreviation")%></td>
<td width="86" ><%=Equipment("BusinessArea")%></td>
<td width="88" ><%=Equipment("SalesOffice")%></td>
<td width="140" ><%=Equipment("Contact")%></td>
<td width="146" ><%=Equipment("ContactPhoneNumber")%></td>
<td width="123" ><%=Equipment("Area")%></td>
</tr>
<%
Equipment.MoveNext
Loop
%>
</table> Here is the code for the edit page: <form method="POST" action="edit_location.asp?LID=<%=Request("LID")%>" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
<table width="754" height="216" cellspacing="0" cellpadding="0">
<tr>
<td width="412" bgcolor="#cccccc" align="right" >*Description</td>
<td width="338"><input type="text" name="Description" size="35" tabindex="1" value=<%=Equipment("Description")%>></td>
</tr>
<tr>
<td width="412" bgcolor="#CCCCCC" align="right" >Abbreviation</td>
<td width="338"><input type="text" name="Abbreviation" size="35" tabindex="2" value=<%=Equipment("Abbreviation")%>></td>
</tr>
<tr>
<td width="412" bgcolor="#CCCCCC" align="right" >Business Area</td>
<td width="338"><!--webbot bot="Validation"
S-Data-Type="Number" S-Number-Separators=",." --><input type="text" name="BusinessArea" size="35" tabindex="3" value=<%=Equipment("BusinessArea")%>></td>
</tr>
<tr>
<td width="412" bgcolor="#CCCCCC" align="right">Sales Office</td>
<td width="338"><!--webbot bot="Validation" S-Data-Type="Number" S-Number-Separators=",." --><input type="text" name="SalesOffice" size="35" tabindex="4" value=<%=Equipment("SalesOffice")%>></td>
</tr>
<tr>
<td width="412" bgcolor="#CCCCCC" align="right">Contact</td>
<td width="338"><input type="text" name="Contact" size="35" tabindex="5" value=<%=Equipment("Contact")%>></td>
</tr>
<tr>
<td width="412" bgcolor="#CCCCCC" align="right">Contact Phone Number</td>
<td width="338"><input type="text" name="ContactPhoneNumber" size="35" tabindex="6" value=<%=Equipment("ContactPhoneNumber")%>></td>
</tr>
<tr>
<td width="412" bgcolor="#CCCCCC" align="right">Region</td>
<% if Equipment("Area")="Northeast" then %>
<td width="338"><select size="1" name="Area">
<option selected value>Northeast</option>
<option>Southeast</option>
<option>Midatlantic</option>
<option>Midwest</option>
<option>Northwest</option>
<option>Southwest</option>
<option>West</option>
<% elseif Equipment("Area")="Southeast" then %>
</select>
<td width="338"><select size="1" name="Area">
<option>Northeast</option>
<option selected value>Southeast</option>
<option>Midatlantic</option>
<option>Midwest</option>
<option>Northwest</option>
<option>Southwest</option>
<option>West</option>
<% elseif Equipment("Area")="Midatlantic" then %>
</select>
<td width="338"><font face="Arial"><select size="1" name="Area">
<option value>Northeast</option>
<option value>Southeast</option>
<option selected value>Midatlantic</option>
<option>Midwest</option>
<option>Northwest</option>
<option>Southwest</option>
<option>West</option>
<% elseif Equipment("Area")="Midwest" then %>
</select>
<td width="338"><select size="1" name="Area">
<option>Northeast</option>
<option>Southeast</option>
<option>Midatlantic</option>
<option selected value>Midwest</option>
<option>Northwest</option>
<option>Southwest</option>
<option>West</option>
<% elseif Equipment("Area")="Northwest" then %>
</select>
<td width="338"><select size="1" name="Area">
<option>Northeast</option>
<option>Southeast</option>
<option>Midatlantic</option>
<option>Midwest</option>
<option selected value>Northwest</option>
<option>Southwest</option>
<option>West</option>
<% elseif Equipment("Area")="Southwest" then %>
</select>
<td width="338"><select size="1" name="Area">
<option>Northeast</option>
<option>Southeast</option>
<option>Midatlantic</option>
<option>Midwest</option>
<option>Northwest</option>
<option selected value>Southwest</option>
<option>West</option>
<% elseif Equipment("Area")="West" then %>
</select>
<td width="338"><select size="1" name="Area">
<option>Northeast</option>
<option>Southeast</option>
<option>Midatlantic</option>
<option>Midwest</option>
<option>Northwest</option>
<option>Southwest</option>
<option selected value>West</option>
<% end if%>
</select></td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1" class="submit">
<input type="reset" value="Reset" name="B2" class="submit"></p>
<p>Required Field </p>
</form>
_____________________________
Marissa Insanity: doing the same thing over and over again and expecting different results. --Albert Einsten
|
|
|
|
sentinel
Posts: 569 Joined: 5/4/2005 From: Chicago, Illinois Status: offline
|
RE: Database record not displaying correctly - 11/8/2005 9:39:35
What are your field types in your database? Your code works on my end.
_____________________________
No matter where you go, there you are.
|
|
|
|
KCIWebMaster
Posts: 524 From: Fredericksburg VA USA Status: offline
|
RE: Database record not displaying correctly - 11/8/2005 9:46:31
They are all text fields.
_____________________________
Marissa Insanity: doing the same thing over and over again and expecting different results. --Albert Einsten
|
|
|
|
KCIWebMaster
Posts: 524 From: Fredericksburg VA USA Status: offline
|
RE: Database record not displaying correctly - 11/8/2005 9:55:29
I should have looked through these threads just a little longer before I posted. Right on page 1 I found the answer. I was missing some quotation marks. Thanks anyway!
_____________________________
Marissa Insanity: doing the same thing over and over again and expecting different results. --Albert Einsten
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|