simbawoomba Posted January 4, 2007 Share Posted January 4, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/32829-i-have-found-my-problem-quick-soloution-needed/ Share on other sites More sharing options...
ToonMariner Posted January 4, 2007 Share Posted January 4, 2007 have you managed to confuse php with asp or js?templateList.value is a construct from more traditional oop languages. Quote Link to comment https://forums.phpfreaks.com/topic/32829-i-have-found-my-problem-quick-soloution-needed/#findComment-152840 Share on other sites More sharing options...
simbawoomba Posted January 4, 2007 Author Share Posted January 4, 2007 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 arrayi hope this makes sense,or if there is another way around what i am trying to domy array is in php and therefore i think i need to use php in this bit Quote Link to comment https://forums.phpfreaks.com/topic/32829-i-have-found-my-problem-quick-soloution-needed/#findComment-152843 Share on other sites More sharing options...
taith Posted January 4, 2007 Share Posted January 4, 2007 if your wanting active content on one page, you will need ajax/js. php will not help here. Quote Link to comment https://forums.phpfreaks.com/topic/32829-i-have-found-my-problem-quick-soloution-needed/#findComment-152859 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.