We have a form:

<form name="poisk" action="result.php" method="get"> Оплата за: <select name="za_chto"> <option value="все" checked="checked">Всё равно </option><option value="вариант1">вариант1 </option><option value="вариант2">вариант2 </option><option value="вариант3">вариант3 </option><option value="вариант4">вариант4 </option></select> <input type="submit" value="Поиск"> </form> 

How can you make it so that after a click from a drop-down list for a variant, for example, "option1", the brand selection form becomes visible, if the user chooses "option2", then the price selection form becomes visible, and so on. Those. several parameters would already be available to the user, depending on his initial choice.

Or, for example, if the user chose "option1", then he would be among the direction to the page "a", if "option2", then to the page "b".

How to do this?

  • 2
    In my js. Not? - LordySL
  • Yes, but how to do it. I think using onClick. Here is the time: <code> <option value = "auto" onClick = "javascript: window.alert ('test');" /> test </a> </ code> But it does not work. - nick777
  • one
    If you do so to send through the pages is simple value = "1.html" And I don’t study js sorry) - LordySL
  • The fact is that the whole process should take place immediately after the click. Well, anyway, thanks for the help. - nick777
  • With javascript it will work out. Put the appearance code of some part of the form in the onChange event in select . - Crasher

1 answer 1

Solved a problem with selectedIndex.

 <script type="text/javascript"> function selectnew(){ if(cat.selectedIndex=='1'){ path = 'Выплаты: <select name="test"><option value="test1" checked="checked" />Всё равно</option><option value="test2">Были</option><option value="test3">Не было</option></select>'; } tre.innerHTML = path; } </script>