Jump to content

prichardson

Members
  • Posts

    97
  • Joined

  • Last visited

Everything posted by prichardson

  1. Thanks pulpfiction,That worked like a gem!Most appreciated...
  2. Thanks Yahweh,I have now got it insert into the table.However, now it inserts only the first option of the ddlist even if you have chosen a different option. I think it has taken the first row of the table that displays the options.Here is the code that ddlist is: (and below this is piece of code is -code for the submit button with hidden fields) <td width="90" height="30" class="admintext"><strong>Category:</strong></td><td height="30" class="admintext"><select name="category" id="category" style="width:130px;"><option value="">Please Select</option><%While (NOT rsCategories.EOF)%><option value="<%=(rsCategories.Fields.Item("Blog_01_Category").Value)%>"><%=(rsCategories.Fields.Item("Blog_01_Category").Value)%></option><%rsCategories.MoveNext()WendIf (rsCategories.CursorType > 0) ThenrsCategories.MoveFirstElsersCategories.RequeryEnd If%></select></td></tr> and hidden field for the category next to my submit code: <input name="Blog_01_Category" type="hidden" value="<%=rsCategories("Blog_01_Category")%>" />
  3. Hello,Can anyone help me please.I have a navigation that has 4 levels and it is done on a node system where the category(level) has an ID which has child levels e.g. level 2, level 3 etc.. and they will know which level 1 to be associated by the 'parent id' i.e. the level 1 id.I have products for every levels. Except this piece of code says if there is a catID then display products. But when you first arrive ont he page there is no catId(until you click on one of the levels). So I need to have the same code that states if the catid equals nothing then display the 4 products in a table. To do this i want to do a "show if". I got it like this so far, so can anyone help me out please: *******If NO catID (i.e. when i first arrive on page) to display 4 pictures in the page within a table)************<%if catID = "" then%><% If rsP.EOF And rsP.BOF Then %> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="160"><div align="center"> <a href="<%=strURLPath%>test3.asp?catID=1"><img src="assets_cm/FILES/image/bearings1.jpg" alt="<%=DoApostrophe(strProductTitle)%>" width="120" height="90" border="0"></a> </div></td> <td width="160"><div align="center"> <a href="<%=strURLPath%>test3.asp?catID=2"><img src="assets_cm/FILES/image/bearings2.jpg" alt="<%=DoApostrophe(strProductTitle)%>" width="120" height="90" border="0"></a> </div></td> </tr> <tr> <td width="160"><div align="center"> <a href="<%=strURLPath%>test3.asp?catID=3"><img src="assets_cm/FILES/image/bearings3.jpg" alt="<%=DoApostrophe(strProductTitle)%>" width="120" height="90" border="0"></a> </div></td> <td width="160"><div align="center"> <a href="<%=strURLPath%>test3.asp?catID=4"><img src="assets_cm/FILES/image/bearings4.jpg" alt="<%=DoApostrophe(strProductTitle)%>" width="120" height="90" border="0"></a> </div></td> </tr> </table><% End If %>*****************************************If there is a catId then do this ... ****<%if catID <> "" thenset rsP = objconn.execute ("SELECT * from products where catID=" & catID )while not rsP.eof%> <form action="test3.asp" method="post" name="textsubmitform" id="textsubmitform"><img src="assets_cm/FILES/image/<%=rsP("ximage")%>" border="0"> <%=rsP("name")%> £ <%=rsP("price")%> etc etc..
  4. Hello,Can anyone help me. I am using asp and access. I have a foreign key on the two tables to link them.I have a dynamic dropdownlist that gets the options from 'weblog_Blog_01_Category table' and it displays on the page in the dd/list. At the end of the form there is a submit button which has the rest of the fields such as 'title', 'intro' etc goes to this table 'weblog_Blog_01 table'.As i mentioned that i have got the dd/list to get the category options from the 'category table' but i want when the user clicks on submit to put the option from the dropdown list to appear in the 'entry table' along with the other data.This is the code that inserts into the table, (all except it leaves the category empty. I want it the chosen option to appear in the category column in the weblog_Blog_01 table. '**** ENTER BLOG IN DATABASE *****************************IF Request.Form("Active") = "True" Thendim strRequestBlog_01Titledim strRequestBlog_01Categorydim strRequestBlog_01IntrostrRequestBlog_01Title = Replace(CSTR(Request.Form("Blog_01_Title")), "'", "''", 1, -1, 1)strRequestBlog_01Category = Replace(CSTR(Request.Form("Blog_01_Category")), "'", "''", 1, -1, 1)strRequestBlog_01Intro = Replace(CSTR(Request.Form("Blog_01_Intro")), "'", "''", 1, -1, 1)'**** Enter Record into database ************dim rsEnterRecorddim strEnterSQLstrEnterSQL = strDBDateFormat & "INSERT INTO weblog_Blog_01 "strEnterSQL = strEnterSQL & "("strEnterSQL = strEnterSQL & "Blog_01_Title, "strEnterSQL = strEnterSQL & "Blog_01_Category,strEnterSQL = strEnterSQL & "Blog_01_Intro "strEnterSQL = strEnterSQL & ")"strEnterSQL = strEnterSQL & " VALUES "strEnterSQL = strEnterSQL & "("strEnterSQL = strEnterSQL & "'" & strRequestBlog_01Title & "', "strEnterSQL = strEnterSQL & "'" & strRequestBlog_01Category & "', "strEnterSQL = strEnterSQL & "'" & strRequestBlog_01Intro & "', "strEnterSQL = strEnterSQL & ")"Set rsEnterRecord = Server.CreateObject("ADODB.Connection")rsEnterRecord.Open MM_connCM001_STRINGrsEnterRecord.Execute strEnterSQLrsEnterRecord.CloseSet rsEnterRecord = Nothing'*******************************************End If
×
×
  • Create New...