Hi, making a custom field dependencies i get a javascript error "Uncaught Error: Syntax error, unrecognized expression: #" (on line 446 of paymentmethods.js).
I made a radio button custom field, then two text custom field dependent on radio button.
When I choose radio button, fields disappears and this is ok. But when I try to show fields pressing radio button i got that error.
Examining the code on media/com_osmembership/assets/js/paymentmethods.js i saw that in the line 456 there's a for loop where the last value is empty. When the line
Code:
$('#' + hideFields[i]).hide();
tries to hide the element hideFields
, it's empty and i get that error. Modifying the code with
Code:
if(hideFields[i] != '')
the problem does not appear anymore. i don't know if i clearly explained the problem, i'm sorry.
the code starting from line 456 was:
Code:
for (i = 0; i < hideFields.length; i++) {
$('#' + hideFields[i]).hide();
}
for (i = 0; i < showFields.length; i++) {
$('#' + showFields[i]).show();
}
i changed that in:
Code:
for (i = 0; i < hideFields.length; i++) {
if(hideFields[i] != '')
$('#' + hideFields[i]).hide();
}
for (i = 0; i < showFields.length; i++) {
if(showFields[i] != '')
$('#' + showFields[i]).show();
}
Maybe I made some mistake?