\t\t\t \t\t\tif( errors.length > 0 ){ \t\t\t\t\$.each(errors, function(i,e){ \t\t\t\t\ttoastr.error(e, 'Notification'); \t\t\t\t}); \t\t\t\treturn false; \t\t\t} \t\t}); \t\t \t\t\$('#sekolah').change(function(){ \t\t\tvar t = \$(this).val(); \t\t\t\$.getJSON('index.php?module=subjek&action=load&sekolah='+t, function(resp){ \t\t\t\t\$('#subjek').empty(); \t\t\t\t\$.each(resp, function(i,e){ \t\t\t\t\t\$('#subjek').append('<option value="'+e.id+'">'+e.nama+'</option>'); \t\t\t\t}); \t\t\t}); \t\t}); JS; if (!empty($_SESSION['error'])) { $js .= <<<JS \t\ttoastr.error( '{$_SESSION['error']}', 'Error Notification' ); JS; unset($_SESSION['error']); } $js .= <<<JS \t}); \t</script> JS; View::addJavascript($js);