Below is some code i use to get a list of categories from a database, Into a drop down box.
At the bottom i have just a text field called "title".
How can i update the field "title" with whe data that is selected in the catergory field
These two fields need to be the same but i done want to make the user type it in.
any help would be great....
<select name="category">
<%
dim objRS
set objrs=objconn.execute("select * from categories"
if objrs.eof then
%>
<script>
window.open('add_category.asp','Add','toolbar=no,width=450,height=200,menubar=no,resize=no')
</script>
<%
end if
do while not objrs.eof
'if just added make selected
if request.querystring("cat" = objrs("category" then
response.write "<option selected value='" & objrs(0) & "'>" & objrs("category"
else
response.write "<option value='" & objrs(0) & "'>" & objrs("category"
end if
objrs.movenext
loop
set objrs = nothing
set objconn = nothing
%>
</select>
<%
'added category notice
if len(request.querystring("cat") > 0 then
Response.write "<font color='" & actioncolor & "'>Title Added</font>"
end if
if request.querystring("added" = "link" then
Response.write "<font color='" & actioncolor & "'>Link Added</font>"
end if
%>
------------
<input size="50" name="title" value="">
At the bottom i have just a text field called "title".
How can i update the field "title" with whe data that is selected in the catergory field
These two fields need to be the same but i done want to make the user type it in.
any help would be great....
<select name="category">
<%
dim objRS
set objrs=objconn.execute("select * from categories"
if objrs.eof then
%>
<script>
window.open('add_category.asp','Add','toolbar=no,width=450,height=200,menubar=no,resize=no')
</script>
<%
end if
do while not objrs.eof
'if just added make selected
if request.querystring("cat" = objrs("category" then
response.write "<option selected value='" & objrs(0) & "'>" & objrs("category"
else
response.write "<option value='" & objrs(0) & "'>" & objrs("category"
end if
objrs.movenext
loop
set objrs = nothing
set objconn = nothing
%>
</select>
<%
'added category notice
if len(request.querystring("cat") > 0 then
Response.write "<font color='" & actioncolor & "'>Title Added</font>"
end if
if request.querystring("added" = "link" then
Response.write "<font color='" & actioncolor & "'>Link Added</font>"
end if
%>
------------
<input size="50" name="title" value="">