<html> <head> </style> </head> <body> <form id="f"> <input id="i"> </form> <button id="b">push</button> <script> b.onclick=function(){ if(i.value=="foo") f.submit() } </script> </body> </html>