Hi, can i ask if this is my form and i will use the .submit how do i returned message successfully or failed after submitting the form using .submit


HTML Code:
 <form id="myform" action="tomyprocess.php">
    <input type="text" name="Fname">
   <input type="text" name="Mname">
  <input type="text" name="Lname">
</form>
is this correct ?

Code:
 $(function(){
   $('myform').submit(function(data){
        if(data=='successfull'){
         alert("success");
     } 
     
   });
});
thank you in advance.