This topic is locked

ajax image loading

3/17/2011 10:49:22 AM
PHPRunner General questions
T
tedwilder author

hello,

On my add page I use a lookup dropdown that choose the right string ( url ) for the right customer logo to be printed.

So I only have the name of the file in the lookupfield that is showed :
I put a "view as":

$sql = "SELECT * FROM logo WHERE idlogo =".$data["idlogo"];

$rs = CustomQuery($sql);

$datalog = db_fetch_array($rs);

$value= $datalog["fichierlogo"];

So it retrieve "fichier logo " wich means it retrieve the name " somelogo.png " .

what I'd like to do is to load on the add page the actual file, so user can see if the logo that is going to be printed is the right one.

So the difficulty is to load a new picture at each time user change the customer name that in return change the idlogo ( dependant lookup ). any idea how I can load a different picture each time value in idlogo is changed?

thank you.