ReportingAnalyst
MIS
Hi,
I built a small ASP page which pulls the top level category "Beverage" from Northwind database. When I click on the link, Beverage, I can see all the products that fall under the category "Beverage". However I would like to click on the link again to hide the products and click on the link again to see the products. To do so, I have a function that shows and hides a UL tag list.
I get an object required error whenever I click on the link at line 57.
Here is my Javascript funtion:
For your information, I have 2 Javascript functions that associated with the onClick event. 2nd one is as follows:
HTML Line where I get the error is below in bold:
Any tips what I am doing wrong?
Thanks.
I built a small ASP page which pulls the top level category "Beverage" from Northwind database. When I click on the link, Beverage, I can see all the products that fall under the category "Beverage". However I would like to click on the link again to hide the products and click on the link again to see the products. To do so, I have a function that shows and hides a UL tag list.
I get an object required error whenever I click on the link at line 57.
Here is my Javascript funtion:
Code:
function s_Hide(el){
alert("Showing Element: "+el);
objID = 'UI_'+el;
alert(objID);
obj = document.getElementById(objID).style;
(obj.display == 'none')? obj.display = 'block' : obj.display = 'none';
}
For your information, I have 2 Javascript functions that associated with the onClick event. 2nd one is as follows:
Code:
function showProducts(str)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="getProducts.asp"
url=url+"?ID="+str
//alert(url);
//url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged1
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
HTML Line where I get the error is below in bold:
Code:
<ul id="menu">
<li>
<input type="radio" checked name="prodid" id="Catid1" value="1">
[b]<a href="#" class="a_style" onclick="showProducts(1);s_Hide('1');">Beverages</a>[/b]
<ul id="UI_1">
<div id="content_products">
</div>
</ul>
</li>
</ul>
Any tips what I am doing wrong?
Thanks.