The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$jQuery is not defined error from helpers.php
#1
In the helpers.php file the following function exists:

function display_errors($errors = array()){
$html = '<ul class="bg-danger">';
foreach($errors as $error){
if(is_array($error)){
echo "<br>";
$html .= '<li class="text-danger">'.$error[0].'</li>';
$html .= '<script>$jQuery("#'.$error[0].'").parent().closest("div").addClass("has-error");</script>';
}else{
$html .= '<li class="text-danger">'.$error.'</li>';
}
}
$html .= '</ul>';
return $html;
}

When I call this function, I always get $jQuery is not defined error. Why would this occur? What am I missing?

I am calling the function using the following code:

<?php echo resultBlock($errors,$successes);
if (!$form_valid && Input::exists()){
echo display_errors($validation->errors());
}
?>
  Reply


Messages In This Thread
$jQuery is not defined error from helpers.php - by muhammedc - 04-26-2017, 12:14 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)