你可以动态加载表单参数

I have worked some recapthca into my web form and want to maintain the client side form validation. As the form currently is

  <form action="ajax/ajax_repSubTesting.php" method="POST" name="submitform" onSubmit="checkform(this)">

checkform() is a series of if/else statements to inform the user that a data field is either blank or not valid. Problem is that once the submit button is clicked , the checkform is called popping up an error window, and once closed the ajax script is called.

How would I code this so that the form action is dependent on everything in checkform() validated properly?

Returning false from an inline onsubmit event handler will will cancel the form submission. The checkform function should return false (as appropriate) for invalid form data

function checkform () {
   if (!valid) { return false; }
   // ..
}

and the returned value must be propagated through the inline event handler

<form .. onsubmit="return checkform()">
                   ^^^^^^

See also

(Also, 'ajax' is normally called via XHR, not form submission.)

try adding id to the submit button and yhe form itself. Then at the beginning of the validation method add event.preventDefault(); Which will cancel the form submition.

Then at the end of the validation method if the form is valid add the next jQuery method: $('form').submit() it will trigger form submition.