PDA

View Full Version : PHP and listbox problems


sarahstim
07-26-2002, 05:14 PM
I am trying to populate a listbox component through MMX dynamicaly with PHP. I have the PHP code working and it returns a string formatted:

$rString = "n=".$num;
$rString .= "&id".$i."=".$row['id']."&title".$i."=".$row['title'];
$rString .= "&description".$i."=".$row['description']."&author".$i."=".$row['author'];
$rString .= "&submitted".$i."=".$row['submitted']."&caption".$i."=".$row['caption'];


it works!

I need to dynamically populate the listbox with the title. I am then going to do onSelect function to populate the other data into other text fields on the screen. Very straight-forward.

I can't get the darn listbox to populate. Here is my actionscript:
__________________________________________________
function showContent()
{
for(var i=0; i< this.n; i++){
listBox_lb.addItem(title[i],i);
}
}

// Create new load vars object c for data transfer
var a = new LoadVars();
a.load("flashmx_dbPassReturn.php","POST");
a.onLoad = showContent;

________________________________________________

HELP PLEASE...
-t

snowedin
07-26-2002, 05:33 PM
Well, for a start, remember you're passing a string.

You need to convert any vars
that you want to treat as number.

For example, this.n is still a string.

Try parseInt(n) before the for loop.