netLynx
03-23-2012, 05:29 PM
I'm not that familiar with classic ASP or Javascript but need to change an exisiting program to do the following:
Add a link to a page but only for certain marketers.
I have a classic ASP page that has a couple of hyperlinks for each marketer that is selected from a combobox drop down. The new hyperlink is to be added but only for select marketers. The rest don't even get to see this new hyperlink.
I added a function in Javascript as such:
function IsPikeESCO(UID,UCD)
{
var strTemp;
var mktrno,mktname;
var frm;
var IsPike;
IsPike = false;
frm = document.Downloads;
strTemp=frm.MKTRACCT.options[frm.MKTRACCT.selectedIndex].text;
mktrno=strTemp.substring(0,10);
switch (mktrno)
{
case 8:
IsPike = True;
break;
case 99:
IsPike = True;
break;
case 162:
IsPike = True;
break;
}
return IsPike;
}
Now I need to check if True then display the hyperlink, so I came up with this, which I know is not correct:
<tr><td></td><td
<%IF <a HREF="javascript:IsPikeESCO('<%response.write request("passUID")%>','<%response.write request("passUCD")%>')" = True THEN%>
onMouseOver="/orradata/pike.DAT">Pike Data</font></a>
<%END IF%>
I want to be able to check the fuction for each marketer and if return is TRUE, then produce the hyperlink which will open a data file if clicked.
Can someone help? I'm not sure how to use the <%IF statement in conjunction with a javascript function that checks for a return value, and based on that return value, does some action.
Add a link to a page but only for certain marketers.
I have a classic ASP page that has a couple of hyperlinks for each marketer that is selected from a combobox drop down. The new hyperlink is to be added but only for select marketers. The rest don't even get to see this new hyperlink.
I added a function in Javascript as such:
function IsPikeESCO(UID,UCD)
{
var strTemp;
var mktrno,mktname;
var frm;
var IsPike;
IsPike = false;
frm = document.Downloads;
strTemp=frm.MKTRACCT.options[frm.MKTRACCT.selectedIndex].text;
mktrno=strTemp.substring(0,10);
switch (mktrno)
{
case 8:
IsPike = True;
break;
case 99:
IsPike = True;
break;
case 162:
IsPike = True;
break;
}
return IsPike;
}
Now I need to check if True then display the hyperlink, so I came up with this, which I know is not correct:
<tr><td></td><td
<%IF <a HREF="javascript:IsPikeESCO('<%response.write request("passUID")%>','<%response.write request("passUCD")%>')" = True THEN%>
onMouseOver="/orradata/pike.DAT">Pike Data</font></a>
<%END IF%>
I want to be able to check the fuction for each marketer and if return is TRUE, then produce the hyperlink which will open a data file if clicked.
Can someone help? I'm not sure how to use the <%IF statement in conjunction with a javascript function that checks for a return value, and based on that return value, does some action.