Jump to content

prichardson

Members
  • Posts

    97
  • Joined

  • Last visited

prichardson's Achievements

Newbie

Newbie (1/7)

0

Reputation

  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?
×
×
  • Create New...