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

jQuery

Avatar of undefined
Last Comment
Jaber Ahmad
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Jaber Ahmad
Jaber Ahmad
Flag of Côte d'Ivoire image

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
Avatar of Jaber Ahmad
Jaber Ahmad
Flag of Côte d'Ivoire image

ASKER

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!

jQuery
jQuery

jQuery (Core) is a cross-browser JavaScript library that provides abstractions for common client-side tasks such as Document Object Model (DOM) traversal, DOM manipulation, event handling, animation and Ajax. jQuery also provides a platform to create plugins that extend jQuery's capabilities beyond those already provided by the library.

19K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo