There is a form.

<form method="post" action="/admin/edit_category/<?echo $category['id']?>"> <article class="module width_full"> <header><h3>Новая катСгория</h3></header> <div class="module_content"> <fieldset> <label>НаимСнованиС ΠΏΠΎΠ΄ΠΊΠ°Ρ‚Π΅Π³ΠΎΡ€ΠΈΠΈ</label> <input type="text" value="<?echo $category['title']?>" name="title" required=""> </fieldset> <fieldset> <label>НаимСнованиС ΠΊΠ°Ρ‚Π΅Π³ΠΎΡ€ΠΈΠΈ</label> <input type="text" value="<?echo $main_category['title']?>" disabled=""> </fieldset> <div class="clear"></div> </div> <footer> <div class="submit_link"> <input type="submit" value="ΠžΠΏΡƒΠ±Π»ΠΈΠΊΠΎΠ²Π°Ρ‚ΡŒ" class="alt_btn" name="edit"> <input type="submit" value="Назад" class="back"> </div> </footer> </article><!-- end of post new article --> </form> 

There is a script

 <script> $(document).ready(function(){ $(".back").click(function(){ window.location="/admin/list_categories"; }); }); </script> 

When you click on the button back, it does not follow the link in the script. Why?

  • Because the mistake is knocked out in the console, which you do not show us)) And on the basis of it one could say something .... maybe the jquery version is not compatible with click - Alexey Shimansky
  • The console is empty, it works on a click, but stupidly reloads the page, and does not go to the one I need - duddeniska
  • Change the type="submit" the Back button to type="button" , semantically it is not very good to keep more than two submit buttons in one form. - Vitaly Emelyantsev
  • Thanks helped - duddeniska
  • In principle, the problem is just that. What does submit instead of click trigger? It is not clear why two buttons submit - Alexey Shimansky

0