Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 21st, 2004, 06:41 AM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to use Onclick function for this

Hi,
I am retrieving Hierarichical data from data base on the basis of parentid and want to show child data on Clicking on parent data.Code written is using layers .4 level of data is existing on click of 2nd data i want 3rd and 4th level data to be displayed .In this code if I remove mouseover ,On clicking the Subcategory ,Data gets overridden on the first data which i got from when i click first Subcategory.
Please let me know how to make the data stay at the place and on next click it should show corresponding data without overwriting on first.


Set courrs = Server.CreateObject("ADODB.recordset")
strQuery1="select * from course_master where course='Nets'"
courrs.Open strQuery1,objConn, 3, 3

<%
strQuery2="select * from category_mast where courseid=" &courrs("courseid")
catrs.Open strQuery2,objConn, 3, 3
if not catrs.EOF then
while not catrs.eof %>

 <p class="head-1"><%=catrs("category")%></p>
<%strQuery3="select * from subcategory_mast where categoryid=" & catrs("categoryid")
subcatrs.Open strQuery3,objConn, 3, 3%>
<%while not subcatrs.EOF%>
<p>- <a class="right-link" href="#" onClick="MM_showHideLayers('<%=subcatrs("subcatego ry")%>','','show','curr-main','','hide')" onMouseOut="MM_showHideLayers('<%=subcatrs("subcat egory")%>','','hide','curr-main','','show')"><%=subcatrs("subcategory")%></a><br>

<%
                             strQuery4="select * from curriculum_mast where subcategoryid=" & subcatrs("subcategoryid")
currirs.Open strQuery4,objConn, 3, 3
while not currirs.EOF%>

<div id="<%=subcatrs("subcategory")%>" style="position:absolute; left:310px; top:145px; width:256px; height:169px; z-index:2; visibility: hidden">
 <p class="head-1"><%Response.Write(currirs("curriculum"))%></p>

<%
strQuery5="select * from content_mast where curriculumid=" & currirs("curriculumid")
conrs.Open strQuery5,objConn, 3, 3
while not conrs.EOF %>
 <%Response.Write(conrs("content"))%><br>
<%conrs.MoveNext
wend
conrs.Close%>
<%currirs.MoveNext
 wend
 currirs.Close%>
 </div>
  <% subcatrs.MoveNext
  wend
 subcatrs.Close %>
  <%catrs.MoveNext
   wend
   end if%>











Similar Threads
Thread Thread Starter Forum Replies Last Post
Button onclick function in Repeater rathbird General .NET 12 April 5th, 2007 03:17 AM
Invoke onClick() function when body onLoad muklee Javascript How-To 2 March 16th, 2007 01:02 AM
onClick crmpicco Javascript How-To 1 March 21st, 2005 09:18 AM
onClick crmpicco HTML Code Clinic 2 February 24th, 2005 11:28 AM
How to use Onclick function for this jaya2109 BOOK: Beginning ASP 3.0 5 June 22nd, 2004 07:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.