2 Replies Latest reply on Mar 9, 2011 5:55 PM by iconofsin14

    javascript form submission

    iconofsin14 Level 1

      A site which i have inhereted from a client uses a javascript to submit a form

       

      this is a simple form and there is no reason why the data could not have been sent using HTML

       

      the Javascript itself is also simple, it seams to do little more than connect to an external JS which validates the form data.

       

      here is it

      ----

      <script type='text/javascript'>
      <!--
      function postMsg(){
      $.post("booking_process.php",getFields("info"),
         function(data){
      if(data.length<1) {
        $("#show").html("<tr><td>THANKS, WE HAVE RECEIVED YOUR MESSAGE MESSAGE AND WILL GET BACK TO YOU SHORTLY</td></tr>")
      }else{alert(data);}
      });}
      -->
      </script>

      ----

       

      my question is why have they used this script instead of submitting via the form?