How to disable the submit action?

There is a code
the <script>
 function valid(){
 var kkal = $("input[name='myradio']:checked").val();
 if(!kkal) return $('#massageError').html("<font style='color:red'>Select a Program</font><br>");

How to make so that when the Submit button is clicked the form is not performed actions of the action attribute, and returned on the select button?
July 5th 19 at 00:06
2 answers
July 5th 19 at 00:08
The code is not enough, but that form is not sent at the touch, all you need to do return false;
For example:
$("#form").on('submit', function(e) {
 return false; // nothing happens
e.preventDefault() - Royal.Sauer56 commented on July 5th 19 at 00:11
: return false; efficiently - ursula_Corwin86 commented on July 5th 19 at 00:14
: return false; puts e.the stoppropagation() in vanilice return false; not a ride - Royal.Sauer56 commented on July 5th 19 at 00:17
July 5th 19 at 00:10
$('form').on('submit', function (event) {
 // your manipulation 

Find more questions by tags JavaScriptjQuery