Jump to content

i have found my problem, quick soloution needed


simbawoomba

Recommended Posts

i have the following code

[code]<select  size="10" id="templateList" name="templateList" onchange="<?php $a = strtoint(templateList.value);
print $templateList>value;
    echo 'displayTemplate('.$templateArray[$a][1].',MessageTemplate)';

?>

">;

<?php
  print $numberOfTemplates;
  for ($i=0 ; $i<$numberOfTemplates; $i++){
 
print '<option value="'.$i.'">'.$templateArray[$i][0].'</option>';
  } 
 
  ?>

                        </select>                [/code]

Specifically in this bit of code :

[code]
$a = strtoint(templateList.value);
[/code]

the templateList.value is not actually passing the value, it is just passing the text templateList.value. could someone please help, it should be passing the actual value of templateList.valuewhich is "0" or "1" or somthing like that,

thanks
nooo the templateList.value is the value of the listbox,

i have a listbox and a text area, depending on what is selected from the listbox, a different message will be shown in the text area,

to get what has been selected from the listbox i use templateList.value, which is the name of the listbox, and the . value bit returns the value of which option has been selected, i can get this number to print out into the text box, but i dont want the number, i want to use the number to select thr right peice of text from an array

i hope this makes sense,

or if there is another way around what i am trying to do

my array is in php and therefore i think i need to use php in this bit

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.