Page 1 of 2
Error in function nuSetTitle()
Posted: Sun Mar 05, 2023 4:36 pm
by mih
Hello.
Function nuSetTitle() doesn't work - form title remains old after calling this function. Only works in popup mode, when there is no "Logout" icon in the breadcrumb line. It seems that because of the "Logout" element (has the nuNotBreadcrumb class), the index for the jQuery call, setting the title, is incorrectly counted.
Re: Error in function nuSetTitle()
Posted: Sun Mar 05, 2023 4:41 pm
by kev1n
Hi,
There's been a fix recently. Not sure if that helps though.
https://github.com/nuBuilder/nuBuilder- ... b870c8d90a
Re: Error in function nuSetTitle()
Posted: Sun Mar 05, 2023 5:20 pm
by mih
in github diff there is one version, but version in release archive is different
I've got an error within nuform.js version in release archive.
I suggest to substract $('#nuLogout').length then counting index.
Or, if class '.nuNotBreadcrumb' is assigned only to the LAST item in breadcrumb, count only $(''.nuBreadcrumb').length.
Re: Error in function nuSetTitle()
Posted: Sun Mar 05, 2023 5:53 pm
by kev1n
You also need the current nubuilder4.css
Re: Error in function nuSetTitle()
Posted: Mon Mar 06, 2023 6:52 am
by mih
OK. The latest release has an older version of css. Is it safe to use the latest 'master' branch (not yet included in the release)?
Re: Error in function nuSetTitle()
Posted: Mon Mar 06, 2023 7:30 am
by kev1n
You may use the master branch or just use its updated nuform.js, nubuilder4.css
Re: Error in function nuSetTitle()
Posted: Wed Mar 29, 2023 9:42 pm
by vario
I just noticed this issue. Copied nuform.js & nubuilder4.css from master but doesn't work. Is there a fix available?
DB Version: V.4.5-2023.02.21.01
Files Version: V.4.5-2023.02.21.00
Re: Error in function nuSetTitle()
Posted: Wed Mar 29, 2023 10:10 pm
by kev1n
I'm sorry to hear that the nuSetTitle() function is not working as expected. To better assist you, I would need more information about the specific context in which you're using this function.
Are you using nuSetTitle() on a main form or a popup form, Browse, Edit, etc?
Are there any error messages in the browser's console after calling the function?
A screenshot could help as well.
Once I have more information about your implementation, I'll be better equipped to help you troubleshoot and find a solution to your issue.
Re: Error in function nuSetTitle()
Posted: Wed Mar 29, 2023 10:45 pm
by kev1n
Try the latest nuform.js and let me know if it works for you.
Re: Error in function nuSetTitle()
Posted: Thu Mar 30, 2023 8:57 pm
by vario
I'm using it in the "Custom Code" section of the form to change the breadcrumb on edit forms, for example
Code: Select all
if (nuFormType() == 'edit'){
nuSetTitle($('#emp_forename').val()+' '+$('#emp_surname').val());
}
If I use the nuform.js from github master, the login screen is visible (though badly formatted if I also use the new nubuilder4.css) and I cannot get the application to load. The following (abbreviated) messages are in the console:
Code: Select all
Uncaught SyntaxError: expected expression, got '<'
Uncaught ReferenceError: nuUXOptions is not defined (from index.php:112)
Uncaught ReferenceError: nuMainForm is not defined (from index.php: 204)
Uncaught ReferenceError: nuBuildForm is not defined
I'm running on Arch Linux with PHP 8.2.4 & Apache 2.4.56
Neil.