Have tried to make the form with user forms and script search.js jusing code:
Search.js
<script type="text/javascript" charset="utf-8">
function FilterModels() {
var makeslist = document.getElementById('makes');
var modelslist = document.getElementById('models');
var make_id = makeslist.options[makeslist.selectedIndex].value;
var modelstxt = new Array();
modelstxt[1] = "1\tEscort\n2\tTaurus";
modelstxt[2] = "1\tAltima\n2\tMaxima";
var models = modelstxt[make_id].split("\n");
for (var count = modelslist.options.length-1; count >-1; count--){
modelslist.options[count] = null;
}
for (i=0; i<models.length; i++){
var modelvals = models.split("\t");
var option = new Option(modelvals[1], modelvals[2], false, false);
modelslist.options[modelslist.length] = option;
}
}
</script>
For the userforms i used html block for manufacturer with code:
<select name="makes" onchange="FilterModels()" id="makes">
<option>--</option>
<option value="1">Ford</option>
<option value="2">Nissan</option>
</select>
and for html bloxk model this code:
<select name="models" id="models">
<option>Choose Make</option>
</select>
But when i submit the query it gives blank fields how i can fix it.
the tutorial can be fond here:
http://www.nerdydork.com/dynamic-filtered-drop-down-choice-fields-with-django.html