Hi,
Visforms can be used with a module, displayed inside an article or published via a menu item and it is actually possible to have multiple forms on one page and you can display a form in a modal window using the component.php (
www.vi-solutions.de/en/documentations/vi...rm-in-a-modal-window
) which is a common way in Joomla! to only display the component. If the server side form validation fails and you have used any of the ways to display the form, the form will be displayed again and the user inputs, which were already made, are used inside the form. Further on, Visforms displays error messages then.
I decided on displaying the error messages inside the form, using the standard Joomla! HTML tags and classes as for the system message, in order to make sure, that the error messages are always displayed and are always near the form (with component.php in a modal window, the messages would not be visible and with multiple forms on one site, it could be confusing, if the message are apart from the form).
Nevertheless, the error messages are created by a Visforms layout file, which can be overriden in your template. The layout file - messageblock.php - is located at components\com_visforms\layouts\visforms\error. Create a copy of this file in templates\yourTemplate\html\layouts\com_visforms\visforms\error
Replace the following code from the override file
Code:
$html .= '<div class="alert alert-danger">';
$html .= '<button class="close" data-dismiss="alert" type="button">×</button>';
if (!empty($displayData['context']))
{
switch($displayData['context'])
{
case 'dataeditform':
$html .= '<h4 class="alert-heading">' . JText::_('COM_VISFORMS_EDIT_FORM_HAS_ERROR') . '</h4>';
break;
default:
$html .= '<h4 class="alert-heading">' . JText::_('COM_VISFORMS_FORM_HAS_ERROR') . '</h4>';
break;
}
}
else
{
$html .= '<h4 class="alert-heading">' . JText::_('COM_VISFORMS_FORM_HAS_ERROR') . '</h4>';
}
with
Code:
$app = JFactory::getApplication();
In the foreach statement replace
Code:
$html .= '<p>' . $errormessage . '</p>';
with
Code:
$app->enqueueMessage($errormessage, 'error);
delete the line
I think this is roughly what you want to do.
Regards,
Aicha