I have a web api application in which I have this form :
     <form id="editForm">
                    <input id="editid" type="hidden" name="id" />
                    <p><label>Numéro cnss </label><input id="cnss" name="cnss" /><label style="color:red" id="labError"> ( * )</label></p>
                    <p><label>Nom </label><input id="lastname" name="lastname" /><label style="color:red" id="labError"> ( * )</label></p>
                    <p><label>Prénom </label><input id="firstname" name="firstname" /><label style="color:red" id="labError"> ( * )</label></p>
                    <p><label>Adresse   </label> @Html.TextArea("address", new { id = "address" })<label style="color:red" id="labError"> ( * )</label></p>
                    <p><label>Lieu de naissance </label><input id="birth_place" name="birth_place" /> </p>
                    <p><label>Mutuelle </label><input id="mutuelle" name="mutuelle" /><label style="color:red" id="labError"> ( * )</label></p>
                    <p><label>Caisse d'assurance maladie </label><input id="caisse_assu_maladie" name="caisse_assu_maladie" /><label style="color:red" id="labError"> ( * )</label></p>
                    <p>
                        <label>Type de client   </label>
                        <select id="client_type" name="client_type">
                            <option value="demande de transport régulière sur une période">demande de transport régulière sur une période</option>
                            <option value="demande de transport régulière et indéfinie">demande de transport régulière et indéfinie</option>
                            <option value="Ponctuel ">Ponctuel </option>
                        </select>
                    </p>
                </form>
 <button id="btnStepTwo" type="submit" class="btn btn-primary" >Commencer la réservation</button>
in the Api controller, I have this action :
 [HttpPost]
        public bool ValidateClient(ClientModel item)
        {
            return ModelState.IsValid;  
        }
I'd like to add a javascript method for every change in the form, this method calls the ValidateClient service to verify if the model in the form is valid or not : If the model is valid ==> the button will be enabled, otherwise it will be disabled.
- How can I accomplish this task?
- What is the best and easiest way?
 
    