samedi 30 mars 2019

Submit button not working when there are multiple fields present

When there is multiple address generated, the Submit button does not work.

I've tried to solve it with JavaScript.

                   @foreach ($userDetails as $addr)
                       <div class="order_container">
                           <input type="hidden" name = "userName" value="" >
                           <input type="hidden" name = "userMobile" value="" >
                           <input type="hidden" name = "userSelectAddress" value="" >
                           <input type="checkbox" name="userSelectAddressId" value="" id="id1"/>


                            <br>
                            <br>
                            <br>
                           <br>
                       </div>
                   @endforeach

JS

function validate_radio(){
            /*alert("fail");
            return false;*/
           // let inpObj = document.getElementById("id1").value.checked;
            if(document.getElementById('id1').checked){
                alert("pass");
            }
            else {
                alert("else");
                return false;
            }
        }

I expect the submit button to work no matter how many address i have selected.

Thank you in advance.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2FJ3UIm
via IFTTT

Aucun commentaire:

Enregistrer un commentaire