View Single Post
  #3  
Old 08-27-2007, 11:31 AM
 
sjbt sjbt is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 35
 

Default Re: Embedded page with dynamic data problem

I'm passing php variables to javascript so that within the javascript there are php tags with while loops, then back to js, then pull in x1 php variable, back to js, pull in x2 php variable, etc. It's messy. But I inherited it and it works outside of X-Cart/Smarty.

I've got it to show the basic data now but part of the function is that a choice in one field updates another field (onchange). That part is not working. Is X-Cart preventing an onchange event or is something in the function being interefered with?

This line:
<select name="itemlist" size="10" onchange="chlist()">

Is calling this js function:
function chlist()
{
e=document.orderfrm;
var p=e.itemlist.selectedIndex;
e.prodid.value=pid[p];
e.desc.value=pdesc[p];
e.amount.value=pprice[p];
if(p==0)
{
alert("Please select an Item");
return false;
}
}
__________________
X-Cart 4.1.8
Reply With Quote