Javascript error when I hide fields from module
- Jonathan Dagenais
-
Topic Author
- Offline
- New Member
-
- Posts: 4
- Thank you received: 0
Sorry for my bad english.
I had a Javascript error when I try to hide fields (name and antispam) from module.
It seems related to the javascript function nspro_parseErrors(response){ }.
On the source code iIt seems to always check for these fields.
var field_array = [ "name", "email", "as_answer" ];
Thanks for your great component.
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
Thank you for posting.
How did you try to hide the name and anti spam fields?
Thanks again.
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Please Log in or Create an account to join the conversation.
- Jonathan Dagenais
-
Topic Author
- Offline
- New Member
-
- Posts: 4
- Thank you received: 0
I try to hide the fields from the module configuration screen. In the basic tab, I select to hide the name and anti-spam field.
I attached the screenshot of the configuration screen.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
- Jonathan Dagenais
-
Topic Author
- Offline
- New Member
-
- Posts: 4
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- Christopher Mavros
-
- Offline
- Administrator
-
I fixed it and committed the update. It should be available for download online within the next 3 hours.
If you want the fix immediately, feel free to email me and I can send it to you via email.
Thanks again.
Christopher Mavros
me@mavxr.com
If you like our extensions, please rate us on the JED!
Please Log in or Create an account to join the conversation.
- Jonathan Dagenais
-
Topic Author
- Offline
- New Member
-
- Posts: 4
- Thank you received: 0
Maybe, it can be easier to add the error class to the div containing the fields instead of given class directly on field.
I made some change on these files :
/administrator/components/com_nspro/lib.php
function PrintExtraFieldsInForm($beforeOrAfter, $field_list, $fixed_fields, $name_prefix, $sfx = '', $unique_id = '') {
$db = JFactory::getDBO();
$db->setQuery('SELECT * FROM `#__nspro_fields` WHERE `published` = 1 ORDER BY `ordering` ASC');
$afields = $db->loadObjectList();
foreach($afields as $afield) {
if ( (($beforeOrAfter == 'before') && (!$afield->abovepos)) // we want before, but field is not abovepos
|| (($beforeOrAfter == 'after') && ($afield->abovepos)) ){ // or we want after, but field is abovepos
continue;
}
if ($field_list == '1') {
$fieldarray = explode(',', $fixed_fields);
if (!in_array($afield->id, $fieldarray)) {
continue;
}
}
if ($afield->fieldtype != '7') {
$js_uid = str_replace(' ', '_', $unique_id).'_';
print '<div class="nspro_field" id="nspro_'.$js_uid.'field'.$afield->id.'_grp">';
if ($afield->name != '') {
print '<span class="nspro_field_label">'.JText::_($afield->name).'</span>';
}
}
print '<div class="nspro_custom_field_input_wrapper">'.GetFieldInputModulePlugin($afield, $sfx, $name_prefix, $unique_id).'</div>';
if ($afield->fieldtype != '7') {
print '</div>';
}
}
}
I also attached my modified /components/com_nspro/views/nspro/tmpl/default.php
Please log in or register to see it.
Thanks for your great support
Please Log in or Create an account to join the conversation.