"R.G. Vervoort" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> Not sure if it is a php question but since i am working in php here it is.
>
> Ho can i add items to (the item label=visual text and the value=index
> number) a list object on a website.
>
> I am having a list with 4 items and i would like to add the text from a
> textfield (textfield1.value) to the list object so it will hold 5 items.
>
> thanks for any suggestions
>
> Roy
> The Netherlands
PHP is server side, it looks like you want to send items to a client
side app (javascript?) you could do something like this:
--->Snip!
<?php
$array = array('item1', 'item2', 'item3', 'item4'); //I use an array
here for simplicity, you could do the same with a dB query or the like
echo "<html>\n<head></head><!--javascript-->"; //Not a javascript guy,
but you get the point
foreach($array as $key=>$item) {
echo "\n textdata.item$key=$item";
}
?>
<body> etc.....
<---
Not sure how javascript looks (started working with it in last 2 days)
but you can change that echo statement to what it should be in
javascript
Cheers!
Robert
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php