Quote:
Originally Posted by komplexbs
I actually used a php variable inside that function :-/
Sorry, I forgot to add the parameter, but the same error still occurs.
|
I think in the rush to get this fixed you may not be paying full attention to what I am saying. Whether php-generated or not, your HTML source code needs to include single quotes around the value 'zfield_' in order to resolve the javascript error in the page. Once the javascript error is resolved we can work on getting the functionality to do what you actually want it to do.
So if, for example, your php script generates the line like so:
PHP Code:
print "<select class=\"primary\" name=\"Test Field\" id=\"zfield_1\" tabindex=\"1\" onchange=\"ajaxReq(1, this.value, ".$peid.");\">\n";
you would need to amend it to be like this instead:
PHP Code:
print "<select class=\"primary\" name=\"Test Field\" id=\"zfield_1\" tabindex=\"1\" onchange=\"ajaxReq(1, this.value, '".$peid."');\">\n";
Or, if you generate the line like this:
PHP Code:
<select class="primary" name="Test Field" id="zfield_1" tabindex="1" onchange="ajaxReq(1, this.value, <?php print $peid; ?>);">
then you would need to make it like this instead:
PHP Code:
<select class="primary" name="Test Field" id="zfield_1" tabindex="1" onchange="ajaxReq(1, this.value, '<?php print $peid; ?>');">
In any case, no matter how you generate the <select> tag and its attributes you *need* to get single quotes around that parameter in the HTML output.