Validation on form stopped working (mootools?)

ontarget

Active Member
Hi,
I have a multipage / group form using form_1.js file for validation plus a bunch of fabrik js built in validations.
I'm using J3.10.11 and latest F3 from github with php7.4 (and was working previously with php8.0) .

See the files attached for error and JS used.

When i click the next button in the form i get a lot of console errors see below and a spinning icon saying "Validating".

Is there anything that can help me identify the validation that might be causing the issue or is it more of a general issue with F3 and J3?
I turned on js errors in Fabrik. it identified one element which i unpublished but the form still wont go to the next page.

Thanks for any help!
 

Attachments

  • consoleerror.txt
    15.6 KB · Views: 15
  • form_1.txt
    12.9 KB · Views: 12
Migrated the site and its working better.
Getting the following error it must be some deprecation but I can't see anything wrong...
PHP:
Error
An error has occurred with a eval'd field - please inform the web-site owner.
    Debug: Eval exception : school_details (id 208)::_getV() : $id = ''; 
//added this if else to allow NCSE ETB schools to claim 
$category = 'Arts in Education'; 
if ($id[0] == 7 && $category != 'NCSE') { echo "Sorry this is an ETB School Roll Number. You cannot claim using this system"; return false; } 
else { $db = JFactory::getDbo(); 
$query = $db->getQuery(true); 
$query 
//->select(array('schoolName', 'address1', 'address2', 'county' ,'eircode')) 
->select(array('schoolName', 'address2', 'county' ,'eircode')) 
->from('aaa_schools') 
->where('schoolRoll = ' . $db->quote($id)); 
$db->setQuery($query); 
$rows = $db->loadObjectList(); 
$list = array(); foreach ($rows as $row) { $list[] = "

School: " . $row->schoolName . "
" . "
Address: " . $row->address2 . "
" ."
County: " . $row->county . "
" . "
Eircode: " . $row->eircode . "
"; } return "
" . implode($list) . "
"; } 
//see http://fabrikar.com/forums/index.php?threads/solved-calc-element-to-return-multiple-results.41128/ : Uninitialized string offset 0
 
I don't see you are defining the variable $id anywhere in your code.

Is this "eval default" code in the field element?
 
Thanks for the replies,
the $id is actually defined but wasnt showing in the error for some reason - maybe because the {aaa_participant_claim___school_roll_raw} is on a different page and there is a calc on load ?
The var_dump brings back a string so it seems ok.
I had js errors turned on but when i turn them off the form is validating ok.
I will need to upgrade this system eventually to J4 and F4.... which I'm sure will result in more fun and games!

PHP:
$id = '{aaa_participant_claim___school_roll_raw}';
var_dump($id);
exit;
//added this if else to allow NCSE ETB schools to claim 
$category = '{aaa_participant_claim___category}';
if ($id[0] == 7 && $category != 'NCSE')
{
echo "<span style='color:red;'>Sorry this is an ETB School Roll Number. You cannot claim using this system</span>"; 
return false;
}
else {
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query
    //->select(array('schoolName', 'address1', 'address2', 'county' ,'eircode'))
    ->select(array('schoolName', 'address2', 'county' ,'eircode'))
    ->from('aaa_schools')
    ->where('schoolRoll = ' . $db->quote($id));
$db->setQuery($query);
$rows = $db->loadObjectList();
$list = array();
foreach ($rows as $row)
{
    $list[] = "<li> School: " . $row->schoolName . "</li> " . "<li>Address: " . $row->address2 . "</li>" ."<li>County: " . $row->county . "</li>" . "<li> Eircode: " . $row->eircode . "</li> ";
}
return "<ul>" . implode($list) . "</ul>";
}
 
The var_dump brings back a string
This doesn't say much, it can be just the {aaa_participant_claim___school_roll_raw} string (Does it say string(43)?)

The code in the debug error message is showing
$id = '';
So obviously here $id is empty and so $id[0] doesn't exist.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top