Hello,
I am having trouble duplicating some code that works fine in IE, but Netscape doesn't like atall. I have searched everywhere.
Right now I have a page with many drop down menu's. Beside all the drop downs there is a link. This link get's updated onChange of the related drop down(by calling update_url()). This is what I did for IE and it works.
catname is the name of the affected drop down menu, productID is just a value I need. catid is the name of the HREF link that corresponds to the affect drop down.
This code above work fine in IE with the following HTML. Code between the <? ?> tags is PHP.
IE can set the HREF value like this . I cannot find anything that can do it in Netscape. I read in a couple of threads and did it myself, that if you don't have HREF defined in your tags then the document.links[] array will not contain that link.
So I tried the HTML like this.
But now my problem is how to access the correct HREF and change it's value. This is what I tried for Netscape.
My problem is on the comparison of the Link name, I don't know how to do it. Is there anyway to do that? Or am I going about this totally the wrong way?
Help is greatly appreciated.
Thanks alot,
-Josh
I am having trouble duplicating some code that works fine in IE, but Netscape doesn't like atall. I have searched everywhere.
Right now I have a page with many drop down menu's. Beside all the drop downs there is a link. This link get's updated onChange of the related drop down(by calling update_url()). This is what I did for IE and it works.
Code:
function update_url(catid, catname){
if(Netscape){
do whatever... ??
} else {
tmpID = document.all.item(catname).value.toString().split(":");
productID = tmpID[0];
if(productID == '0')
document.all.item(catid).href='';
else
document.all.item(catid).href='../page1/script.php?mode=view&pid='+productID;
}
}
This code above work fine in IE with the following HTML. Code between the <? ?> tags is PHP.
Code:
<A NAME=<?=$catname?> TITLE="View Product Details" onClick="javascript:openURL(this.href);return false;">View Details</A>
So I tried the HTML like this.
Code:
<A HREF="#" NAME=<?=$catname?> TITLE="View Product Details" onClick="javascript:openURL(this.href);return false;">View Details</A>
Code:
function update_url(catid, catname){
if ((document.layers) || ((document.all) && !(document.getElementById))) {
tmpID = catname.toString().split(":")
productID = tmpID[1];
for(i=0; i<=(document.links.length - 1);i++){
if(document.links[i] == catid)
document.links[i].href='../page1/script.php?mode=view&pid='+productID;
}else {
IE stuff...
}
Help is greatly appreciated.
Thanks alot,
-Josh