I'm stuck...
I have a simple xhtml (mobile) form that contains a dropdown list of items and a textarea.
In use the user selects an item off the list, clicks an 'insert' button and it get added to the textarea. In my application the dropdown list is used to speed up data entry for Cell phone users - the idea is to use the dropdown list to drops 'commands' in to the textarea- so the user does not have to enter the command(s) AND the data required by the command(s)... I will have a list of about 30 commands, each requires additional data to be entered:
SHOW_MESSAGE hi world
SHOW_MESSAGE is inserted from the dropdown, the hi world part is the data entered by the user...
First Questions:
The xhtml suff is done, but the PHP scrip is giving be trouble:
<select name="itemlist">
<option value="1">SHOW_MESSAGE</option>
<option value="2">SEND_MESSAGE</option>
</select>
<input type="submit" name="submit" value="insert">
<?
if ($POST['submit'])
{
echo '<input type="hidden" name="already_selected[]" value="'.$POST[itemlist].'">';
}
echo <textarea name="mycmds">;
if (is_array($POST['already_selected']))
{
foreach ($POST['already_selected'] as $key => $value)
{
echo $value;
}
}
echo $_POST['mycmds'];
echo '</textarea>';
?>
This does't seem to work - What did I miss?
Second Questions:
Ideally I would like to embed this in the xhtml code - is this possible, or does it always have to be a seperate PHP file?
Thanks for any help!
Ian C