Jump to content

prichardson

Members
  • Posts

    97
  • Joined

  • Last visited

Everything posted by prichardson

  1. Thanks for your reply,I have tried your suggestion or maybe i was not able to get it to work. If you could have a look at what code i have at the moment, and maybe if you could suggest how best to complete the idea of being able to submit the ddlist without the use of a submit button. <script type="text/javascript" language="JavaScript"><!--function DoSubmission() {document.MyForm.submit();}//--></script> <%'**** Category Drop Down List ***************************dim strWriteDropDownCategorydim strDropDownLoopCategorydim strCategoryValuePathstrWriteDropDownCategory = "" While (NOT rsCategories.EOF) strDropDownLoopCategory = (rsCategories.Fields.Item("Blog_01_Category").Value) strWriteDropDownCategory = strWriteDropDownCategory & "<option value=""" & strDropDownLoopCategory & """>" & strDropDownLoopCategory & vbcrlf rsCategories.MoveNext()WendIf (rsCategories.CursorType > 0) ThenrsCategories.MoveFirstElse rsCategories.RequeryEnd If'*****************************************************%> <form name="MyForm" action="index.asp" method="get" onClick="DoSubmission();"> <select name="Blog_01_Category" onchange="myForm.submit();"><option value="" selected>View Blogs by Category</option><option value="All categories">All categories</option><%=strWriteDropDownCategory%></select> </form>
  2. Can anyone tell me an url for a good dropdownlist that gets data from the db and displays (so far i have got this to work)... but I want to select the item from the dropdownlist (without submit button) and when the option is selected, it to display the records from the option on the page.Example: ddlist has 5 categories and each category has blog posts to their category. When the category is selected by clicking on the text (no submit button) then it would display all the blog posts from that category on the page.How do i get:a) to select the option with NO submit buttonb_) to display all the posts in that category on the page.Any advice or good urls that do this (a and b parts) ... I have hunted and not found anything exctaly what i am looking for.Thanks
  3. How can I make my alert box message appear in bold red colour? Here is my javascript for the alert box: <script language="JavaScript"><!--function confirmSubmit(){var agree=confirm("Are you sure you wish to DELETE this category AND ALL THE BLOG POSTS in this category?");if (agree) return true;else return false;}//--></script>
  4. This is what i have got so far- which will show all the cricket for example, but i have to 10 categories and they could change on a frequent basis, so how can i get make it dynamic? "SELECT Blog_01_Title, Blog_01_Intro FROM weblog_Blog_01 INNER JOIN weblog_Blog_01_Category ON weblog_Blog_01.Blog_01_Category = weblog_Blog_01_Category.Blog_01_Category WHERE weblog_Blog_01_Category.Blog_01_Category = 'cricket'" Any suggestions or ideas anyone?
  5. Hi Jesh,This is correct layout: However the category will not be fixed, which means that the categorys will change (because you can add/delete the categories in the admin area). Therefore I think the 'like' is making it static to 'programming' so...How can i adapt the sql statement you have said so that it is more dynamic. Would an If statement in the recordset or asp code to make it dynamic?Thanks,
  6. Hi Jesh,My tables:Blog_01 table> Blog_01ID > Blog_01_Categoryetc. etc.Blog_01_Category table >Blog_01CategoryID >Blog_01_CategoryThe thing is that the options is not done from a drop down, it is displayed as text on the navigation bar as dynamic asp code that I have put up on the first post.There is more than one variable here...> To display the categories on the navigation bar > when category on navigation bar is clicked then "all the posts from that particular category" to appear in the main body of page.There is 2 places of what happens- 1 is the naviagtion but the second bit is getting all the posts to appear in the center of the page with all the posts.Therefore I am assuming that in the SQL statement i need to write something that combines both elements. Thanks
  7. Hi Jesh,Blog_01 table has blog_01ID and has 'Blog_01_Category'and Blog_01_Category table has Blog_01CategoryID and has 'Blog_01_Category'However the List is dynamic and therefore the categories will change, so I think that the sql statement will have to be a little more complex to solve the answer.Jesh- how would you put an sql statement with the above details in the equation?Thanks,Peter
  8. What is the best way to put this scenario into a SQL statement.I want to retrieve the specific from the Blog_01_Category table (which displays the category options) and I want to GROUP all the posts that are in that particular category from the Blog_01 table.I want to add a 'filter' into the equation, so when the user clicks on the hyperlink text category- it will direct the user to all the posts on that category. In a nutshell, if the category list has 10 categories, with each category having many blog posts to it, when the user clicks on a particular category then all the posts on that category to appear on the page. The equation involves 2 tables- one which has the category options (to display the options on the page) and the second table has the posts which has a column that states which category (to Group all these posts to the selected option)This is what i got so far, can someone please tell me what i should add to get the sql statement to work. rsBlog_01_NavCategories.Source = "SELECT DISTINCT Blog_01CategoryID, Blog_01_Category FROM weblog_Blog_01_Category" this is the asp code for the link i have on the page: <% While ((Repeat1__numRows <> 0) AND (NOT rsBlog_01_NavCategories.EOF)) %><tr><td class="textsmall" style="padding:1px"><a class="subnavlevel3" href="<%=strURLPath%>pages/blog_01/blog_01.asp?Blog_01CategoryID=<%= rsBlog_01_NavCategories("Blog_01CategoryID") %>"><%=(rsBlog_01_NavCategories.Fields.Item("Blog_01_Category").Value)%></a></td></tr><% Repeat1__index=Repeat1__index+1Repeat1__numRows=Repeat1__numRows-1rsBlog_01_NavCategories.MoveNext()Wend%>
  9. What SQL Statement should I write to get this desired result:- A drop down list that dynamically displays the (numerous) "product sizes" of a product from a table.At the moment, I have a table "products" that has "product name" and "product sizes". There will be many products that have different sizes. For example. I would have 3 entries in the table, each have the same name, but different sizes. So when user clicks on the drop down list of a product it would display the 3 different sizes. Then when the user has clicked on the size of the product- it to go to that product page which would have more information on that product.Can anyone help me on what code I should write for the SQL statement? Many Thanks
  10. Hello,I am looking for a AJAX navigation for a web page. Does anyone know of any sites that have a script for this?The navigation would be linked to a database that would provide dynamic navigation levels.The navigation would be a vertical on the left handside, like a tree... maybe dom style with nodes- parent and child nodes.I am really interested in knowing which columns should have in the database. I would want to make it easy to understand for an non-IT user. What I mean rather than have numbers to link and communicate the levels of the navigation, is to have the names of the levels as text.I heard AJAX would be a good idea, but i have not found anything that would combine the navigation tree with the database... can anyone help me on this please.Many Thanks
  11. Thanks Patrick,I got it to work... it the sense that the page appears and each product has an id... 1,2, etc... But when I press the button "Add to Basket"... it does not work- in that it does not add to the basket... Why is that??[code<%if catID <> "" thenset rsP = objconn.execute ("SELECT * from products where catID=" & catID )counterNum = 0Do While Not rsP.EOFcounterNum = counterNum + 1 %><form action="test3.asp" method="post" name="textsubmitform" id="textsubmitform"><img src="assets_cm/FILES/image/<%=rsP("ximage")%>" border="0"> <%=rsP("name")%> £ <%=rsP("price")%> <a href='<%=strURLPath%>pages/store/products/ec_view.asp?PID=<%=rsP("ProductID")%>'>View Product Details</a> <a href="java script:SubmitForm('AddToBasket', <%=counterNum%>)"><font color="#000000">Add to basket</font></a> <input name="WhichType" id="WhichType" type="hidden"><input name="Username" type="hidden" id="Username" value="<%=strUsername%>"><input name="ProductID" type="hidden" id="ProductID" value="<%=rsP("ProductID")%>"><input name="ximage" type="hidden" id="ximage" value="<%=rsP("ximage")%>"><input name="name" type="hidden" id="name" value="<%=rsP("name")%>"><input name="price" type="hidden" id="price" value="<%=rsP("price")%>"><input name="sizes" type="hidden" id="sizes" value="<%=rsP("sizes")%>"><input name="make" type="hidden" id="make" value="<%=rsP("make")%>"><input name="Quantity" type="hidden" id="Quantity" value="1"><input name="BActive" type="hidden" id="BActive" value="True"></form><BR><BR><% rsP.movenext Loopend if %>[/code]
  12. Thanks Patrick,I have got this but i get an "Expected statement" error... can you see where i have gone wrong?: <%counterNum = 0Do While Not rsP.EOFcounterNum = counterNum + 1 %><form action="test3.asp" method="post" name="textsubmitform" id="textsubmitform"><img src="assets_cm/FILES/image/<%=rsP("ximage")%>" border="0"> <%=rsP("name")%> £ <%=rsP("price")%> <a href='<%=strURLPath%>pages/store/products/ec_view.asp?PID=<%=rsP("ProductID")%>'>View Product Details</a> <a href="java script:SubmitForm('AddToBasket', <%=counterNum%>)"><font color="#000000">Add to basket</font></a> <input name="WhichType" id="WhichType" type="hidden"><input name="Username" type="hidden" id="Username" value="<%=strUsername%>"><input name="ProductID" type="hidden" id="ProductID" value="<%=rsP("ProductID")%>"><input name="ximage" type="hidden" id="ximage" value="<%=rsP("ximage")%>"><input name="name" type="hidden" id="name" value="<%=rsP("name")%>"><input name="price" type="hidden" id="price" value="<%=rsP("price")%>"><input name="sizes" type="hidden" id="sizes" value="<%=rsP("sizes")%>"><input name="make" type="hidden" id="make" value="<%=rsP("make")%>"><input name="Quantity" type="hidden" id="Quantity" value="1"><input name="BActive" type="hidden" id="BActive" value="True"></form><BR><BR><% rsP.movenext Loopend if %>
  13. Hi Patrick,I have got this: <% counterNum = 0rsP.movenext While counterNum = counterNum + 1 wendend if %> But it is does not work.... am i missing anything in the code above that i should have?Thanks
  14. Hi Patrick,Yeah, it is looping: <% rsP.movenext wendend if %> But what i can not see, is where <%=counterNum%> is pulling any value, cause it is not anyway else saying: counterNum=xyzWhere is the number being generated in this: <a href="java script:SubmitForm('AddToBasket',<%= counterNum %>)"><font color="#000000">Add to basket</font></a> <!--function SubmitForm( selectedtype, num ){ document.getElementById("WhichType" + num).value = selectedtype; document.textsubmitform.submit();}-->
  15. Hi Patrick,I have tried javascript and also java script <a href="java script:SubmitForm('AddToBasket', <%=counterNum%>)"><font color="#000000">Add to basket</font></a><a href="java script:SubmitForm('AddToBasket', <%=counterNum%>)"><font color="#000000">Add to basket</font></a> I think <%=counterNum%> is not pulling any value. I think maybe there is a piece of code that is needed to link the <%=counterNum%> to the javascript code.What code should i put to get them to link-up, so the <%=counterNum%> gets a value?
  16. Hi aspnetguy,Just thinking, and i have not understood how you get the two pieces of code to link together? The <%=counterNum%> and ("WhichType" + num) ? Should we put a <% dim counterNum counterNum = "WhichType" + num%> Or something similar to link the two ?
  17. Thanks aspnetguy,I put in the code, but i am still getting an error. I think we are getting close to solving the problem though...what about at the bottom of the form with this bit of code: <input name="WhichType" id="WhichType" type="hidden"> Do you think we should change this to include the "num" bit or should add an extra input name as "num"?Thanks
  18. Hi aspnetguy,Please can you tell me the code I would need to put in or change to make each one have an unique id?Would you change "selectedtype" to something else? or would it be additional code to put in to make each one have an unique id?I am guessing that it is a word i would need to change from the existing javascript, and I am thinking it is the "selectedtype"? What would it be if it would make the code to work for each product to have an unique id?Thanks
  19. Hi aspnet,This is the entire code for the form which i am refering about:The code below is where the javascript is having the problem i think. I think it has to do something with the "selectedtype" <!--function SubmitForm( selectedtype ){ document.textsubmitform.WhichType.value = selectedtype; document.textsubmitform.submit();}--> The code below is the form that displays the link "Add to Basket". But I am sure it will be the code above that would be worth the look at as it is the lines that displaying the error <form action="test3.asp" method="post" name="textsubmitform" id="textsubmitform"> <img src="assets_cm/FILES/image/<%=rsP("ximage")%>" border="0"> <%=rsP("name")%> £ <%=rsP("price")%> <a href='<%=strURLPath%>pages/store/products/ec_view.asp?PID=<%=rsP("ProductID")%>'>View Product Details</a> <a href="java script:SubmitForm('AddToBasket')"><font color="#000000">Add to basket</font></a> <input name="WhichType" id="WhichType" type="hidden"><input name="Username" type="hidden" id="Username" value="<%=strUsername%>"><input name="ProductID" type="hidden" id="ProductID" value="<%=rsP("ProductID")%>"><input name="ximage" type="hidden" id="ximage" value="<%=rsP("ximage")%>"><input name="name" type="hidden" id="name" value="<%=rsP("name")%>"><input name="price" type="hidden" id="price" value="<%=rsP("price")%>"><input name="sizes" type="hidden" id="sizes" value="<%=rsP("sizes")%>"><input name="make" type="hidden" id="make" value="<%=rsP("make")%>"><input name="Quantity" type="hidden" id="Quantity" value="1"><input name="BActive" type="hidden" id="BActive" value="True"></form><BR><BR><% rsP.movenext wend%><% end if %>
  20. Hi aspnetguy,The problem is that it works fine when the 'Add to Basket' once. But I have several products on the page, so when there is 10 products on the page each product has this link 'Add to Basket'. When there are 10 products on the page the 'Add to Basket' does not work. How can i get the link to work when the link appears more than once on the page?Why is the link not working when it appears more than once?Thanks
  21. Hello,I have this javascript that works when the link appears only once. But I have to have it appear many times through a repeat.The javascript link is: <!--function SubmitForm( selectedtype ){ document.textsubmitform.WhichType.value = selectedtype; document.textsubmitform.submit();}--> I think it has something to do with this line in particular the bold bit, but i am not sure what to change it to: document.textsubmitform.WhichType.value = selectedtype Maybe it is done via a id, and therefore every link has the same id- so would it be a way to identify each link with a unique id?This is my link that displays on the page: <a href="java script:SubmitForm('AddToBasket')"><font color="#000000">Add to basket</font></a> Any help will be appreciated.Thanks
  22. Hello,I am trying to put these styles corrosponding to their levels. Therefore the rootlevel= navlevel0, and level1 (which is the child of rootlevel0) is navlevel1 , and so on with the other levels. <style>a.navlevel0 { font-size:10px; font-weight:bold; font-family:Verdana, Arial, Helvetica, sans-serif; color:#006600;}a.navlevel1 { font-size:10px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#776666;}a.navlevel2 { font-size:9px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#996699;}a.navlevel3 { font-size:8px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#0066FF;}</style> Here is asp code that i am trying to get the above styles to write out on the levels of the navigation system. response.Write( PutSpace(level)&"<a href='?catID="& rsY("catID") &"' class=""navlevel0"">" & rsY("catName") & "</a><br>" )if instr( strExpands, "_" & rsY("catID") & "_") > 0 thentmp = ShowChilds( rsY("catID"), level+1, strExpands)end ifrsY.movenextwend I think what would be great is a function that counts which level it is on and then apply the correct style that corrosponds to the level.Can anyone help me out with what code I would put to get that function to work, or any suggestions on going about it?Thanks
  23. Yahweh,I have now got it add the chosen value when selected and it is now goes into the database table. But there is 2 values there - the one i selected but it has also inserted a value that i did not select.I am sure it is something on the lines of me not keeping the value clear when active is false. I think it has to do something with this code= <%'**** Category Drop Down List ***************************dim strWriteDropDownCategorydim strDropDownLoopCategorydim strCategoryValuePathstrWriteDropDownCategory = ""While (NOT rsCategories.EOF) strDropDownLoopCategory = (rsCategories.Fields.Item("Blog_01_Category").Value) strWriteDropDownCategory = strWriteDropDownCategory & "<option value=""" & strDropDownLoopCategory & """>" & strDropDownLoopCategory & "</option>" & vbcrlf rsCategories.MoveNext()Wend If (rsCategories.CursorType > 0) Then rsCategories.MoveFirst Else rsCategories.Requery End If'*****************************************************%> I think it should be something like this code, but i get an error when i try this = <%'**** Category Drop Down List ***************************dim strWriteDropDownCategorydim strDropDownLoopCategorydim strCategoryValuePathstrWriteDropDownCategory = ""While (NOT rsCategories.EOF) strDropDownLoopCategory = (rsCategories.Fields.Item("Blog_01_Category").Value) strWriteDropDownCategory = strWriteDropDownCategory & "<option value=""" & rsCategories.MoveNext()Wend If (rsCategories.CursorType > 0) Then rsCategories.MoveFirst Else rsCategories.Requery End If'*****************************************************%> Can someone tell how to get the code right?Thanks
  24. Thanks Yahweh for replying,I have tried your suggestions but i still seem to get the problem. I looked at the source code before i chose an option and it automatically has selected a value (in the hidden field)- even before i have selected or pressed submit.I think it has to do something with the 'active'? I wonder if i can solve this with an if statment that says if 'active is false then hidden field is empty 'else if' active is true then hidden field equals the selected value.But i am not sure if this is possible or a good way of solving the problem. I would grateful if you or anyone else can take another look at this to see if there is a way to solving this. strRequestBlog_01Category = Replace(CSTR(Request.Form("Blog_01_Category")), "'", "''", 1, -1, 1) and have the dropdown list is called "Blog_01_Category" ... ( i prefer it be called Blog_01_Catergory rather than category)Any other suggestions?
  25. YahwehI tried your last suggestion by doing: strEnterSQL = strEnterSQL & strRequestBlog_01Category & ", "2 things:1. i put the option as 'cricket' and it is comes out to be 'beer' as you can see below2. this error below appears after i press submit.But got this error:Error Type:Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'beer' 'c', '', 1, '', '', 'right', '', '', 0, '1', '1', '', 'c', 'pedalo', '2007/3/23 15:56:11')'.
×
×
  • Create New...