0

Is it possible to combine the detection of changes for both text field and datepicker?

currently, my code is:

$('#my_textFiled').on('input',function(e){
            console.log($('event Triggered').val());

});

$('#date_received').datepicker().on('changeDate',function(e){
            console.log($('event Triggered').val());            
});

the reason I want to combine them is that I want to determine if the date picker and text field has values so that i can enable a button. I need them BOTH to have values before continuing.

 $('#my_textFiled', '#date_received').on(('input', 'changeDate'),function(e){
                console.log($('event Triggered').val());

    });
Led
  • 683
  • 14
  • 31
  • Possible duplicate of [jQuery multiple events to trigger the same function](https://stackoverflow.com/questions/2534089/jquery-multiple-events-to-trigger-the-same-function) – George Dec 18 '17 at 22:14
  • @George but is it ok on datepicker and textfield? checking on the 2nd part, it has .datepicker().on while textfield has not. – Led Dec 18 '17 at 22:16
  • @cale_b im still looking for solutions – Led Dec 18 '17 at 22:16
  • @cale_b yes im still trying. Updated the question. – Led Dec 18 '17 at 22:20
  • So.... what's the problem? (FYI, I'm out if you can't articulate a problem. You keep saying what you _want_, you provide code, but you don't explain what is / is not working the way you want) – random_user_name Dec 19 '17 at 02:10
  • @cale_b thank you for your time, I think you are correct, I need to change how the way i asked problems. Sorry I was so busy with my task I forget to post anything about this matter. I will close this question and remember next time I ask a question i must be articulate. Thank you very much – Led Dec 20 '17 at 10:14

0 Answers0