1. marshala
  2. Bug Report
  3. Wednesday, June 17 2015, 12:27 AM
JSN 1.3.10, Joomla 3.4.1

The following behaviours occur on the user profile form I am testing. The form has a mandatory select box that is incomplete, and therefore fails pre-submit validation.

  • when a select box set to accept a single option and fails validation that tab is activated and the field highlighted (which is awesome :o )
  • when a select box accepts multiple options and fails validation the field is highlighted, but the tab is not activated. This is inconsistent and not preferable.


Checkboxes show the similar behaviour, as in they don't refocus to the active tab. (I have opened a separate ticket about their validation issues).

Radio buttons fail mandatory validation, and refocus the active tab, but don't appear as errors in the debug panel.

I thought some of these items may be routed in a pattern of validation but I've been unable to determine it, I also haven't ruled out the JFormValidator javascript object.
Accepted Answer
admin Accepted Answer
Admin
Hi,
sorry for late reply, it's a weekend for us.

I assume these enhancements will be in the upcoming .11 release?
Thanks for your test, these changes will be included in next release :)
  1. more than a month ago
  2. Bug Report
  3. # Permalink
admin Accepted Answer
Admin
Hi,
try this quick fix:
- Download and extract attached package
- Replace checkboxlist.php into /administrator/components/com_jsn/models/fields/
- Replace radiolist.php into /administrator/components/com_jsn/models/fields/
- Replace tabs.js into /components/com_jsn/assets/js/
- Replace jsn_system.php into /plugins/system/jsn_system/

if it works properly please leave me a feedback on this topic, we will refine this patch and will include in the next release (scheduled next week)
Attachments (1)
  1. more than a month ago
  2. Bug Report
  3. # 1
marshala Accepted Answer
Content Protected
  1. more than a month ago
  2. Bug Report
  3. # 2
marshala Accepted Answer
I took a quick look at the code for activating the tab with invalid options and found the following.

        $('#member-registration [type="submit"],#member-profile [type="submit"]').click(function(){
var found=false;
$('#member-registration fieldset[aria-invalid="false"],#member-profile fieldset[aria-invalid="false"]').each(function(){
if(!found){
$('a[href="#'+$(this).parents('.tab-pane').attr('id')+'"]').click();
}
found=true;
});
});


In my sample every fieldset has aria-invalid="false" whether it contains invalid fields or not.
  1. more than a month ago
  2. Bug Report
  3. # 3
marshala Accepted Answer
I temporarily fixed the problem by editing the tabs.js file. here's the snippet I modified.


$('#member-registration [type="submit"],#member-profile [type="submit"]').click(function(){
/* Original manufacturer's code.
var found=false;
$('#member-registration fieldset[aria-invalid="false"],#member-profile fieldset[aria-invalid="false"]').each(function(){
if(!found){
$('a[href="#'+$(this).parents('.tab-pane').attr('id')+'"]').click();
}
found=true;
});
*/
// added code to find first instance of invalid field, find fieldset, then activate click action.
var $invalidPanel = $('#member-registration fieldset [aria-invalid="true"], #member-profile fieldset [aria-invalid="true"]').closest('fieldset');
if($invalidPanel){
$('a[href="#'+$invalidPanel.parents('.tab-pane').attr('id')+'"]').click();
}

});


Currently the ARIA attributes are not being maintained the way I would expect them to be (either via the Joomla core or JSN) so either way I would prefer an official solution.
  1. more than a month ago
  2. Bug Report
  3. # 4
admin Accepted Answer
Admin
Hi,
sorry for late reply, we have a completely different time zone :D

try to replace tabs.js with attached file

NOTE: in this script we have also added the highlight of the tab invalid (see screenshot)
Attachments (2)
  1. more than a month ago
  2. Bug Report
  3. # 5
marshala Accepted Answer
Good. The first invalid tab activates, and the invalid tab highlighting is a nice touch. I assume these enhancements will be in the upcoming .11 release?
  1. more than a month ago
  2. Bug Report
  3. # 6
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.