Ecovoyageurs
Member
Hi,
The form content plugin is returning an error "SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data" when I use it on a detail page.
This form is used as a content menu. The user chooses a content title and is redirected to the page (plz see PHP below for better understanding).
This form just has 2 fields : id and dbjoin.
The form has a PHP plugin redirecting the user when he chooses a page. Here is the PHP I use :
The thing is that even if the form is set up to validate without AJAX, it seems to call ajax anyway...
I tried to use a form module instead of the content plugin, but the form module only works on lists. On detail pages, it grabs the detail page id and slug and add it the form id such as
... and then the js on the form isn't working (I trigger the form validation onchange on the dbjoin).
Using the the content plugin would be more flexible than the module, yet do you have an idea of the problem ?
Thanks for your help !
The form content plugin is returning an error "SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data" when I use it on a detail page.
This form is used as a content menu. The user chooses a content title and is redirected to the page (plz see PHP below for better understanding).
This form just has 2 fields : id and dbjoin.
The form has a PHP plugin redirecting the user when he chooses a page. Here is the PHP I use :
PHP:
$db = JFactory::getDbo();
$projet_id = $db->Quote('{fk_projets_recherche___projets_raw}');
if($projet_id!="''"){
$query = "SELECT id, url, itemid_pays FROM jos2_projet WHERE id=$projet_id";
$db->setQuery($query);
$result = $db->loadObject();
$link = "index.php?option=com_fabrik&view=details&formid=5&rowid=".$result->id."-".$result->url."&Itemid=".$result->itemid_pays;
$msg='';
$app = JFactory::getApplication();
$app->redirect(JRoute::_($link,false), $msg, $msgType='message');}
I tried to use a form module instead of the content plugin, but the form module only works on lists. On detail pages, it grabs the detail page id and slug and add it the form id such as
HTML:
<form id="form_31_1:my-page-slug" class="fabrikForm" method="post" name="form_31" enctype="application/x-www-form-urlencoded">
Using the the content plugin would be more flexible than the module, yet do you have an idea of the problem ?
Thanks for your help !
Last edited: