Link to home
Start Free TrialLog in
Avatar of Jaber Ahmad
Jaber AhmadFlag for Côte d'Ivoire

asked on

Send multiple values with jQuery [ input_id: $(this).val() ]

Good evening experts!

I would like to send in addition to code_sms: $(this).val() a second value sel_reference: $(this).val() but I can not. I am using this piece of code to launch a search query for a value in my table, only with one criterion, or I need to put several of them.
Can you help me please ?
Here is my code
$("#mask_codes").keyup(function(e) {
if(document.getElementById("mask_codes").value.length > 5 ) {
    
    $("#verif_ico").html("<i class='fal fa-spinner fa-pulse text-info'></i>").fadeIn("slow");
    $.post("_check-sms.php", {
        
        code_sms: $(this).val()

    }, function(datas){
        if (datas == 'yes') {
            $("#verif_ico").show();
            $("#verif_ico").fadeTo(200, 0.1, function() {$(this).html("<i class='fas fa-check text-success'></i>").fadeTo(900, 1);});
            $("#btn_confirmer").attr("disabled", false);
        } else {
            $("#verif_ico").show();
            $("#verif_ico").fadeTo(200, 0.1, function() {$(this).html("<i class='fas fa-ban text-danger'></i>").fadeTo(900, 1);});
            $("#btn_confirmer").attr("disabled", true);
        }
    });
}
});

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jaber Ahmad

ASKER

Thank you very much Plungjan, problem solved
code_sms: $(this).val(),
sel_reference: $("#sel_reference").val()

Open in new window

Great, - that was not obvious from the information in the original question
Yes I guess, I'm really sorry, Ajax and I really don't get along "yet", but it's going to be fine.
Thank you again for your help, I will try to be more explicit next time and yes your answer has helped me a lot!