<!--#include file ="shared/dbOpenConn.inc"--> <%Response.Buffer = true%> <HTML> <HEAD> <% connstring = "driver={sqlserver};server=kingtest2;uid=classified_user;pwd=class;" set conn = dbOpenConn(connstring) sqlstring = "select * from classfd_subcatagory" set rs = conn.execute(sqlstring) x=0 %> <script language = "JavaScript"> function subcat() cat = document.subad.catagory[document.subad.catagory.selectedIndex].value; url = "submitad.asp?cat=" url = url + cat; window.location.href< = url; function sublist(inform, selecteditem) inform.subcatagory.length = 0 <% count= 0 y=0 do while not rs.eof %> x = <%= trim(y) %> subcat = new Array(); subcatagorys = "<%= trim(rs("subcatagory"))%>" subcatagoryof = "<%= trim(rs("subcat_of"))%>" subcatagoryid = "<%= trim(rs("subcatagory_id"))%>" subcat[x,0] = subcatagorys; subcat[x,1] = subcatagoryof; subcat[x,2] = subcatagoryid; if (subcat[x,1] == selecteditem) { var option<%= trim(count) %> = new Option(subcat[x,0], subcat[x,2]) inform.subcatagory.options[inform.subcatagory.length]=option <%= trim(count)%> <% count = count + 1 y = y + 1 rs.movenext loop %> </script> <title>Submit an Ad</title> <LINK rel="stylesheet" type="text/css" href="style/summary.css"> </HEAD> <BODY onLoad = "sublist(document.subad,document.subad.catagory[document.subad.catagory.selectedIndex].value)"> <!--#include file="shared/menu.inc"--> <% url = "profile.asp" if not request.cookies("userprofile")="" then ln=Request.Cookies("userprofile")("lastname") fn=Request.Cookies("userprofile")("firstname") up=Request.Cookies("userprofile")("workphone") hp=Request.Cookies("userprofile")("homephone") em=Request.Cookies("userprofile")("email") %> <form name = subad action = "thankyouad.asp" > <Table> <tr> <td>First Name</td> <td>Last Name</td> </tr> <tr> <td ><Input NAME="NameFirst" size ="30" value=<%=fn%> ></td> <td><Input NAME="NameLast" size ="40" value=<%=ln%>></td> </tr> <tr> <td>Work Phone</td> <td>Home Phone</td> </tr> <tr> <td><Input NAME="workphone" MaxLength="15" value="<%=wp%>" ></td> <td><Input NAME="homephone" MaxLength="15" value="<%=hp%>" ></td> </tr> <tr> <td>Email</td> </tr> <tr> <td><Input NAME="email" MaxLength="50" value=<%=em%>></td> </tr> </table> <table> <tr> <td>Headline</td> </tr> <tr> <td><Input Name = "headline" MaxLength = "100" value="" size=50></td> </tr> <tr> <td>Description</td> </tr> <tr> <td><textarea name = "description" rows = 5 cols = 50></textarea></td> </tr> <% cat = Request.QueryString("cat") sqlstring = "SELECT * from classfd_Catagory" set rs = conn.execute (sqlstring) %> <tr> <td>Catagory</td> </tr> <tr> <td><SELECT id=catagory name=catagory onChange = "sublist(this.form, document.subad.catagory[document.subad.catagory.selectedIndex].value)"> <OPTION selected value=""></OPTION> <% do until rs.eof %> <OPTION value="<%= rs("catagory_id")%>"><% = rs("catagory")%></OPTION> <% rs.movenext loop set rs = nothing %> </SELECT></td> </tr> <tr> <td><SELECT id = "subcatagory" name="subcatagory"> <Option selected value="none">-------------------------</option> </SELECT> </td> </tr> <tr> <td>Price</td> <tr> <tr> <td><INPUT type="text" id=price name=price></td> </tr> <td><Input type=submit value = "Submit" id=submit1 name=submit1 ></td> </tr> </table > </form> <% Else Response.Redirect url End if %> </BODY> </HTML>