
April 21st, 2000, 02:03 AM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,575
  
Time spent in forums: < 1 sec
Reputation Power: 24
|
|
|
heres the code can somebody look into it and help please?
<i><b>Originally posted by : venkatesh krishnamurthy (venky33@hotmail.com)</b></i><br />if you run this code ,at first only one list box is seen with four options namely keywords which is selected ,categories,author and title.now when you click on categories a second list box appears.this list box has to be filled with records from an table.the code is workin perfectely without the asp code(i.e)retreiving records from the table.but when i include the asp part it gives some error can somebody help?<br />heres the code:<br /> the html file main.htm:<br /><html><br /><head><br /><title>Main Page</title><br /></head><br /><br /><frameset cols="15%,70%" frameborder="no" framespacing=0><br /><frame name="leftframe" src="aspres.asp"><br /><frame name="main" scrolling="auto"><br /></frameset><br /><br /></html><br />the asp file aspres.asp<br /><%@ Language=VBScript %><br /><html><br /><head><br /><title> Test</title><br /><%<br />set myConn=Server.CreateObject("ADODB.Connection")<br /> myConn.ConnectionString ="Provider=SQLOLEDB;Data Source=ABCD;Initial Catalog=IBDW; User ID=sa;Password=;"<br /> myConn.Open <br />%><br /><script language="javascript"><br /><!--<br />function update()<br />{<br />var doc=parent.main.document;<br />if(document.form1.keywords.options[1].selected)<br />{<br />doc.open();<br />doc.write("<html><body>");<br />doc.write("<form name=""form5"" action=""Catres.asp"" method=""post"">");<br />doc.write("<select name = Category size=1>");<br />doc.write("<option selected>Select a Category</option>");<br /><%<br /> Set RS=myconn.Execute ("Select distinct category from IBDW")<br /> While not RS.EOF<br /> Response.Write("<option>"&RS("Category")&"</option>")<br /> RS.MoveNext <br /> wend<br />%><br />doc.write("</select>");<br />doc.write("<input type=image src=go_but.jpg id=image2 name=image2>");<br />doc.write("</form>");<br />doc.write("</body></html>");<br />doc.close();<br />}<br />else if(document.form1.keywords.options[2].selected)<br />{<br />doc.open();<br />doc.write("<html><body>");<br />doc.write("<form name=""form6"" action=""Authores.asp"" method=""post"">");<br />doc.write("<input type=text name=author>");<br />doc.write("<input type=image src=go_but.jpg id=image2 name=image2>");<br />doc.write("</form>");<br />doc.write("</body></html>");<br />doc.close();<br />}<br />else if(document.form1.keywords.options[3].selected)<br />{<br />doc.open();<br />doc.write("<html><body>");<br />doc.write("<form name=""form7"" action=""Titleres.asp"" method=""post"">");<br />doc.write("<input type=text name=title>");<br />doc.write("<input type=image src=go_but.jpg id=image2 name=image2>");<br />doc.write("</form>");<br />doc.write("</body></html>");<br />doc.close();<br />}<br />}<br />//--><br /></script><br /></head><br /><body><br /><form name="form1"><br /><SELECT NAME="keywords" size="1" onChange="update()"><br /><option selected>Keywords</option><br /><option value="1">Categories</option><br /><option value="2">Author</option><br /><option value="3">Title</option><br /></SELECT><br /></form><br /></body><br /></html><br /><br /> <br />
|