I have a menu with a dropdown select!
<select name="category" id="category" required><option value="0">Choose</option><button type="button" onclick="javascript:formsubmit();">Keres</button>
And go on with the value. I have a kwicks panel with this:
<div class='kwicks kwicks-horizontal'>
<a href='#' id='kwick1' onclick="javascript:playerrl(1);"></a>
<a href='#' id='kwick2' onclick="javascript:playerrl(2);"></a>
<a href='#' id='kwick3' onclick="javascript:playerrl(3);"></a>
<a href='#' id='kwick4' onclick="javascript:playerrl(4);"></a>
<a href='#' id='kwick5' onclick="javascript:playerrl(5);"></a>
<a href='#' id='kwick6' onclick="javascript:playerrl(6);"></a>
<a href='#' id='kwick7' onclick="javascript:playerrl(7);"></a>
</div>
And I have an javascript event on my form with my select menu:
<script>
function formsubmit(){
var cat = document.getElementById("category").value;
var search = document.getElementById("search").value;
var iframe = document.getElementById("player");
$(container).kwicks('expand', cat);
iframe.src = "video/index.php?keres="+search+"&category="+cat;
}
</script>
It checks the selected value, changes the iframe src and what not working now is expanding the kwicks panel with the selected value! Firebug says:
ReferenceError: container is not defined
But it is in kwicks.js! Why I get this error?
container
is undefined because you haven't declared it anywhere. Judging from your code it looks like what you need to have is$('.kwicks').kwicks('expand', cat);
... assuming that
cat
is going to be a valid panel index.Edit: also, did you paste all of your
<select>
markup? What you've pasted isn't valid markup as the<select>
isn't closed.