Forum Moderators: open
[edited by: BlobFisk at 12:48 pm (utc) on Jan. 17, 2005]
[edit reason] No URLs please! See TOS [webmasterworld.com] [/edit]
<?php
echo('<td colspan="2" align="right"><select name="select" class="combobox" onchange="disable_location(); submit_value(select.value,'.$HTTP_GET_VARS["lid"].');">'.$prop_types.'</select></td>')
?>
But the 2 javascript functions - disable_location() and submit_value() - are not being executed, which I think is because the onchange event not being triggered.
<?php
echo('<td colspan="2" align="right"><select name="select" class="combobox" onchange="disable_location(); submit_value(select.value,'.$HTTP_GET_VARS["lid"].');">'.$prop_types.'</select></td>')
?>
I think the php quotes and JS quotes need to be escaped (especially the double quoteS)....
<?php
error_reporting(E_ALL); // Crank up error reporting temporarily
echo('<td colspan="2" align="right"><select name="select" class="combobox" onchange="disable_location(); submit_value(select.value,'.$HTTP_GET_VARS['lid'].');">'.$prop_types.'</select></td>');
?>
Also, is the actual HTML output from the script what you intended it to be?
Blobfisk, the single quotes are being used for PHP concenation, rather than for enclosing a JS var. I'm assuming that var is a number, or else it will need another set of singles. And they would need escaping as you said above.
[edited by: Birdman at 3:04 pm (utc) on Jan. 17, 2005]
options[selectedIndex].value