I am using RS Forms Pro and I am able to view a list of submitted forms via a menu link. I am able to view, edit and download the forms from this page. I have since added delete functionality which works as expected. I followed the excellent guide here
What I am trying to do now is probably quite simple however I cannot figure it out.
When the 'delete' button is pressed, the form is deleted and the page refreshes, great. However I would like to display a message (presumably within the system-message div) that reads (something like)
successfully deleted
The delete functionality works however I will include my code for reference.
The script called on form display is as follows (this is set in RS Form config);
// First we have to check the "action" parameter from the URL
$action = JRequest::getWord('action');
if ($action == "delete") {
// If it returns true it will continue running the script
$id_value = JRequest::getInt('id');
$formId_value = JRequest::getInt('formId');
// For security reasons we verify if the user has the right to edit submissions using RSFormProHelper
if ($id_value && $formId_value && RSFormProHelper::canEdit($formId_value,$id_value)){
// If user has enough permission rights, run the query
$db = JFactory::getDbo();
$db->setQuery("DELETE FROM #__rsform_submission_values WHERE `SubmissionId`='". $id_value."'");
$db->execute();
$db->setQuery("DELETE FROM #__rsform_submissions WHERE `SubmissionId`='". $id_value."'");
$db->execute();
// Redirect the user back to Manage directories
$itemId_value = JRequest::getInt('Itemid');
$mainframe->redirect(JRoute::_('index.php?option=com_rsform&view=directory&Itemid='.$itemId_value, false));
}
// If the user does not have permission to edit, he will be prompted with the language override created earlier:
else
$formLayout = JText::_('RSFP_DELETE_ERROR');
}
The code for my delete buton is as follows (override of com_rsform);
<a href="<?php echo JRoute::_('index.php?option=com_rsform&formId='.$this->params->get('formId').'&action=delete&id='.$item->SubmissionId);?>">delete</a>
When I view the page source I can see the empty div above my form where the system message would presumably go?
<div id="system-message-container"></div>
I understand this is related to RS Forms however I am wanting to understand how I pass a value to the system-message div
upon successful deletion.
Suggestions welcome.