HI.
OK - I am not an HTML programmer - I am a VB Programmer and I understand HTML and this is our first venture into ASP with HTML - and I'm stuck.
The Problem.
We have designed a web site for a heavy plant machinery customer where by they can advertise for sale pieces of plant.
The web site, which we have adopted from another web site allows the user to upload a photo and add description price etc etc.
The problem is when they come to edit an entry. We have added a select statement that allows them to choose from a specific list of equipment type and for a new entry this works fine, but when they edit the item the same select list is used but it defaults to the first item in the select list.
What we require is the field to display the current selection that has been saved in the access database - with also the ability to use the drop down list and select a different model type if required.
Our standard field code looks like this:
<input name="Price" size="40" value="<%=rs("Price")%>"></font></td> - "Price" being the stored value from the database.
Our Select Statement looks like this:
<select name="Type" size="1" value="<%=rs("Type")%>">
<option VALUE="BackHoe/Loaders">BackHoe/Loaders
<option VALUE="Breakers">Breakers
<option VALUE="Compressors">Compressors
<option VALUE="Dumpers">Dumpers
<option VALUE="Excavators">Excavators
<option VALUE="Misc">Miscellaneous
<option VALUE="Mixers">Mixers
<option VALUE="Rollers-Tandem/Pedestrian">Rollers-Tandem/Pedestrian
<option VALUE="Skid Steel Loaders">SkidSteelLoaders
<option VALUE="Telescopic Handlers/Forklifts">Telescopic Handlers/Forklifts
</select>
</tr>
<tr>
However the above code section - value="<%=rs("Type")%>"> does not display the stored database value - instead is SHOWS (But has not been stored yet) the first int he select list - "BackHoe/Loaders"
Could anyone provide me with the actual code I need.
Many thanks
Andy.
<%
function chkOpt(v1, v2, selectedValue)
if v1 = v2 then
chkOpt = selectedValue
else
chkOpt = ""
end if
end function
%>
<select name="Type" size="1">
<option VALUE="BackHoe/Loaders" <%=chkOpt("BackHoe/Loaders
<option VALUE="Breakers" <%=chkOpt("Breakers","" & rs("Type"), " selected")%>>Breakers
<option VALUE="Compressors" <%=chkOpt("Compressors",""
<option VALUE="Dumpers" <%=chkOpt("Dumpers","" & rs("Type"), " selected")%>>Dumpers
.....
<option VALUE="Telescopic Handlers/Forklifts" <%=chkOpt("Telescopic Handlers/Forklifts","" & rs("Type"), " selected")%>>Telescopic Handlers/Forklifts
</select>
?