I'm trying to allow a user to click a item that is listed in a Select Multiple form, and click "Go". The Select Multiple is currently being filled by an Ajax updater. The Ajax/Form works great until I add name="subjects" to the Select Multiple, then the Ajax doesn't fill the Select anymore. This is probably a simple fix.
My code:
<form id="searchform" method="get" action="findsyllabi.php">
<input type="textbox" onkeyup="sendRequest()" name="search_query" />
<input type="submit" id="search_select_submit" value="Go">
<input type="hidden" name="searchtype" value="subjects">
<select multiple id="show_results" name="subjects" />
</select>
</form>
<script type="text/javascript" src="http://poseidonwebstudios.com/test/ccl_cms/js/prototype.js"></script>
<script>
function sendRequest() {
new Ajax.Updater('show_results', 'search.php', { method: 'post', parameters: $('searchform').serialize() });
}
</script>
You should use form id. Try this,
$('#searchform').serialize();