SourceTec Software

It is currently Thu Apr 24, 2014 10:29 am

All times are UTC + 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Apr 07, 2008 8:41 am 
Offline
Member

Joined: Fri Mar 28, 2008 4:40 pm
Posts: 8
Dear All,

Warmest Regards.
Thank you for Ellie-support team.

I'm have able to display the text box and cart button in the page. But unfortunally i'm getting error on [unterminated string constant] when trying to include Add To Cart Button. It's not mistaken, is caused by function. If i'm remove the code from below, it's function probably.

Code:
<img src=\"/ge/images/ScB.gif\" name=\"Buy\" onClick=\"javascript:insertToCart(\'\"&Session(\"MemberCode\")&\"\',\'\"&Productcode&\"\',\'\"&Session(\"cmsCountry\")&\"\',\'add\',\'\"&piD&\"\',\'\"&ProdPriceType&\"\')\" border=\"0\" alt=\"Add to Cart\">


Could some one help me to indentify what is the solution?

Actual Code:

Code:
sts_ai("i0",[1,"<%=sName%><table><tr><td> <form name=\"form1\" method=\"post\" action=\"\"><input class=\"textbox\" type=\"text\" name=\"txtProdQty<%=pID%>\" id=\"txtProdQty<%=pID%>\" value=\"1\" size=\"2\" maxlength=\"3\" onChange=\"checkInt(\'txtProdQty<%=pID%>\');\">&nbsp;<img src=\"/ge/images/ScB.gif\" name=\"Buy\" onClick=\"javascript:insertToCart(\'\"&Session(\"MemberCode\")&\"\',\'\"&Productcode&\"\',\'\"&Session(\"cmsCountry\")&\"\',\'add\',\'\"&piD&\"\',\'\"&ProdPriceType&\"\')\" border=\"0\" alt=\"Add to Cart\"></form></td></tr></table>","<%=sLink%>","_self","<%=sImage%>",80,158,"center"],["transparent","7pt Verdana,Arial","#000000","none","7pt Verdana,Arial","#000000","none"]);



My function will be include inside an asp page as below:
Code:
<script language="JavaScript">
function getProdDetail(pcode){
   window.open('productDetail.asp?priceType=<%=ProdPriceType%>&prodcode='+pcode+'&language=<%=strLang%>','_blank','width=700,height=500,scrollbars=yes,resizable=yes');
}

function insertToCart(mCode,pCode,cCountry,act,qty,pt){
   var qtyval;
   qtyval = document.getElementById("txtProdQty"+qty).value;
   ifcart.location.href="<%=iif(isAutoShip,"cart_auto.asp","cart.asp")%>?regprod=<%=regprod%>&MemberCode="+mCode+"&ProdCode="+pCode+"&Country="+cCountry+"&Act="+act+"&language=<%=strLang%>&qty="+qtyval+"&pricetype="+pt;
}
:
:
</script>



Thank you and appreciate for your kindly help.

Regards,
Michelle


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 07, 2008 9:15 am 
Offline
Support Team
Support Team
User avatar

Joined: Thu Aug 01, 2002 5:59 pm
Posts: 1808
Please use the following code:

Code:
sts_ai("i0",[1,"<%=sName%><table><tr><td> <form name=\"form1\" method=\"post\" action=\"\"><input class=\"textbox\" type=\"text\" name=\"txtProdQty<%=pID%>\" id=\"txtProdQty<%=pID%>\" value=\"1\" size=\"2\" maxlength=\"3\" onChange=\"checkInt(\'txtProdQty<%=pID%>\');\">&nbsp;<img src=\"/ge/images/ScB.gif\" name=\"Buy\" onClick=\"javascript:insertToCart(\'<%=Session("MemberCode")%>\',\'<%=Productcode%>\',\'<%=Session("cmsCountry")%>\',\'add\',\'<%=piD%>\',\'<%=ProdPriceType%>\')\" border=\"0\" alt=\"Add to Cart\"></form></td></tr></table>","<%=sLink%>","_self","<%=sImage%>",80,158,"center"],["transparent","7pt Verdana,Arial","#000000","none","7pt Verdana,Arial","#000000","none"]);


Top
 Profile  
 
 Post subject: Functionality Code
PostPosted: Tue Apr 15, 2008 12:11 pm 
Offline
Member

Joined: Fri Mar 28, 2008 4:40 pm
Posts: 8
Dear Support Team,

Thank you for your express reply. However the code that provide still unable to function probably, anyway it's give me hits on how to go about it.

Finally successful getting the functionality code as below:-

Code:
sts_ai("i0",[1,"<%=sName%><table><tr><td> <form name=\"form1\" method=\"post\" action=\"\"><input class=\"textbox\" type=\"text\" name=\"txtProdQty<%=pID%>\" id=\"txtProdQty<%=pID%>\" value=\"1\" size=\"2\" maxlength=\"3\" onChange=\"checkInt(\'txtProdQty<%=pID%>\');\">&nbsp;<img src=\"/ge/images/ScB.gif\" name=\"Buy\" onClick=\"javascript:insertToCart(\'<%=Session("MemberCode")%>\',\'<%=sName%>\',\'<%=Session("cmsCountry")%>\',\'Add\',\'<%=pID%>\',\'<%=ProdPriceType%>\')\"  border=\"0\" alt=\"Add to Cart\"></form></td></tr></table>","<%=sLink%>","_self","<%=sImage%>",80,158,"center"],["transparent","7pt Verdana,Arial","#000000","none","7pt Verdana,Arial","#000000","none"]);


That's all.
Hope it's may help many visitor who encounter the same issue as me. :wink:

Thank you.

Regards,
Michelle


Top
 Profile  
 
PostPosted: Tue Apr 15, 2008 1:48 pm 
Offline
Member

Joined: Fri Mar 28, 2008 4:40 pm
Posts: 8
Dear All,

How can i do this? It's seem below code not working.
Code:
var curCode = getCurrSymbol(Session("hqCountry"), "CurrencySymbol");



The function is exist inside function.asp
Code:
<%
function getCurrSymbol(sPriceType, fn)
    lc_sql="Select " & fn & " from currencyrate where countrylookupid = (Select geolookupid from geolookup where lookupname='Country' and lookupvalue = '"& sPriceType &"')"
    set rsCS = Server.CreateObject("ADODB.Recordset")
    rsCS.open lc_sql, connDynamic, 3, 3
    if not rsCS.eof then
        CurrSymbol = rsCS(fn)
        getCurrSymbol = CurrSymbol
    else
        getCurrSymbol = CurrSymbol
    end if
    rsCS.close
    set rsCS = nothing
end function
%>


Please Advise.

Thank you.

Regards,
Michelle


Top
 Profile  
 
PostPosted: Tue Apr 15, 2008 5:32 pm 
Offline
Member

Joined: Fri Mar 28, 2008 4:40 pm
Posts: 8
Dear All,

Thank you once again. I'm finally getting the solution:-

First of all the function need to be in the page

Code:
strSQL="Select currencysymbol from currencyrate where countrylookupid = (Select geolookupid from geolookup where lookupname='Country' and lookupvalue = '"+Session("cmsCountry")+"')";
   var rsCS = Server.CreateObject("ADODB.Recordset");
   rsCS.open(strSQL, connDynamic,3,3);
   while(!rsCS.eof)
   {
   var curCode = rsCS("currencysymbol");
   }


After that,
Code:
sts_tip("i0",[1,"<table><tr><td><font color=\"gray\"><%=sDesc%></font></td></tr><tr><td><%=det%></td></tr><tr><td><font color=\"red\"><%=usualP%> : <%=strSQL%> <strike><%=DP%></strike></font></td></tr><tr><td><%=MemberP%> :  [b]<%=curCode%> [/b]<%=RP%></table>","stEffect(\"rect\")","",80,0,0,0,"middle","center",300,100],["9pt Verdana,Arial","#000000","none","#FFFFFF","","repeat"]);


That's all.

If anyone have others method of solution, please feel free to share too.

Thank you.

Regards,
Michelle


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group