Merging onsubmit scripts

I have a form which has two scripts that run on submit; one to disable the submit button after being clicked once, the other to add the uk country code to the phoneNumber field. I can only get one of them to run at a time, how can i get them to both run?

  <form action="" method="post" onsubmit="return checkForm(this);"> 
   <input name="PhoneNumber" type="tel" required="">
   <input name="myButton" type="submit" value="Submit">
 <script type="text/javascript">
  function checkForm(form)
    // validate form fields

    form.myButton.disabled = true;
    return true;
function checkForm(f) {
  const phoneNumberField = f.querySelector("[name='PhoneNumber']");
    phoneNumberField.value = "44" + phoneNumberField.value.substring(1);
   return true; // Just for demo to stop the form submitting

77 thoughts on “Merging onsubmit scripts”

  1. 475917 490931Outstanding weblog here! Additionally your web site rather a whole lot up quickly! What host are you making use of? Can I get your affiliate hyperlink for your host? I wish my web site loaded up as quickly as yours lol. 502959