0
I would like to call an event within another event..
Would be the Event B within the else if ($(this).val() == "C")
, of Event A
COMPLETE CODE: https://jsfiddle.net/yswdr7on/
Event A:
$("input[name=situacao]").on('change', function() {
if ($(this).val() == "S") {
//
//
} else if ($(this).val() == "C") {
$(".c").on(); //Não funciona.
$(".recalcula").click(); //Esse funciona.
} else {
//
//
}
}).parent().find("input[name=situacao]:checked").change();
Event B:
$(".c").on('change', function(e) {
if ($(this).prop('checked')) {
//
//
//
} else if (e.bubbles) {
//
//
//
}
$(".recalcula").click();
}).change();
But
$(".c").on(
what?.c
is a class?– Sam
Hello, yes, as the code is very large I thought it best not put to be cleaner the screen. I put in this link for better visualization https://jsfiddle.net/yswdr7on/
– Tiago
@Sam Can you help me?
– Tiago
@Sam doesn’t work either...
– Tiago
Tries
$(".c").trigger("change")
– Sam
@Sam worked, but not as I imagined. I’ll have to redo my code here....
– Tiago