Friendly notice that "Add Field" triggers a JS error in my 3.2-beta1 install due to the following:
functions.fields.js:27
Firefox error: id is undefined
Chrome error: Cannot call method 'replace' of undefined
Friendly notice that "Add Field" triggers a JS error in my 3.2-beta1 install due to the following:
functions.fields.js:27
Firefox error: id is undefined
Chrome error: Cannot call method 'replace' of undefined
This is due to the "id" field not set on the fields to begin with so id is not properly set in the line
var id = $(this).attr('id');
Therefore the lines id=id.replace(.... fail.
I didn't have time to see if the "id" and "name" were both needed or why they "id" was not set when the create_field function calls the appropriate core/fields/ file but to make things simple I just commented out the following lines lines in $.fn.update_names functions.fields.js
var id = $(this).attr('id');
id=id.replace('[fields][999]','[fields]['+new_no+']');
id= id.replace('[sub_fields][999]','[sub_fields]['+new_sub_no+']');
Then at the bottom
instead of $(this).attr('id', id);
I set this:
$(this).attr('id', name);
hence I am making the name and ID fields the same.
WHAT SHOULD PROBABLY BE DONE
I understand that what should happen is that the core templates should properly set the default id value and/or the javascript line:
var id = $(this).attr('id');
should use some sort of if statement and maybe set the id to the name initially if it is null instead ...
This topic has been closed to new replies.