Please help me out here.
I have a file index.php, relevant portion (Jquery is loaded earlier):
<div id="test"></div>
<script type="text/javascript">
$('#test').load("table.php");
</script>
And a file table.php. If no variables are given, an unfiltered table is shown. When table.php loads, it also loads a select field, like:
<select name="testfield" id="testfield" onchange="javascript:setactionfilter();">
<option value="1">Test</option>
<option value="2">Test2</option>
</select>
After that, a script to reload table.php in that testdiv with filtered results:
<script type="text/javascript">
function setactionfilter(){
$('#test').load("table.php?action=".document.getElementById('testfield').selectedvalue);
}
</script>
The problem is that my browser tells me that the getElementById is null, in other words, it can’t find my select field in the page.
Any idea what I am doing wrong?
Change the
.to+Concatenation is done with
+in javascript e.gstring3 = string1 + " " + string2