It is possible so:
Three hidden fields:
<form method="POST" onsubmit="return false;"> <input type="hidden" value="0" id="category1_value" name="category1_value" /> <input type="hidden" value="0" id="category2_value" name="category2_value" /> <input type="hidden" value="0" id="category3_value" name="category3_value"/> <input type="button" value="Перейти к ссылке" onclick="loadFilterPage()" /> </form>
Your 9 blocks will have an onclick property:
<div onclick="document.getElementById('category1_value').value='1'"></div> <div onclick="document.getElementById('category1_value').value='2'"></div> ... <div onclick="document.getElementById('category3_value').value='8'"></div> <div onclick="document.getElementById('category3_value').value='9'"></div>
And add the script:
<script> function loadFilterPage(){ // Получаем значения скрытых полей: var cat1value = document.getElementById('category1_value').value; var cat2value = document.getElementById('category2_value').value; var cat3value = document.getElementById('category3_value').value; // Объединяем их в строку: var catsStr = cat1value + "," + cat2value + "," + cat3value; // В зависимости от строки формируем ссылку: var pageHref; switch(catsStr) { case '1,1,1': pageHref = "1.html"; break; case '1,1,2': pageHref = "2.html"; break; case '1,1,3': pageHref = "3.html"; break; ... case '3,3,2': pageHref = "26.html"; break; case '3,3,3': pageHref = "27.html"; break; default: alert('Неверное значение'); break; } // переходим по найденной ссылке: if(pageHref != ''){ setTimeout('location.replace("'+pageHref+'")', 0); } } </script>
But in general it is strange, in theory there should be one page of the page.php type, it loads by sending the form, there you get the field values in _POST and load the necessary content. But if you need different links - the code above.