Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Javascript error when adding a new record Topic is solved

Questions related to customising nuBuilder Forte with JavaScript or PHP.
kev1n
nuBuilder Team
Posts: 4529
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 518 times
Contact:

Re: Javascript error when adding a new record

Unread post by kev1n »

Does the saving problem occur only with one form or with all forms?
Paul
Posts: 78
Joined: Mon Aug 25, 2025 6:03 am
Has thanked: 17 times
Been thanked: 2 times

Re: Javascript error when adding a new record

Unread post by Paul »

Just the one form.
steven
Posts: 396
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 58 times
Been thanked: 55 times

Re: Javascript error when adding a new record

Unread post by steven »

Paul,

I don't think we are looking at the same database you are using.

For instance this Form's Spirit ITC Investigators Present, the items are from an array and not linked to a table.

Is this the way your problem Form is supposed to work - without linking to another table of investigators?

no_link_inv.png


Steven
You do not have the required permissions to view the files attached to this post.
A short post is a good post.
Buy Kev a Coffee
Paul
Posts: 78
Joined: Mon Aug 25, 2025 6:03 am
Has thanked: 17 times
Been thanked: 2 times

Re: Javascript error when adding a new record

Unread post by Paul »

Yes, that is the way it is intended to work. And we are looking at the same database.
Paul
Posts: 78
Joined: Mon Aug 25, 2025 6:03 am
Has thanked: 17 times
Been thanked: 2 times

Re: Javascript error when adding a new record

Unread post by Paul »

From one of my previous posts here:

"I removed the foreign keys (to devices and investigators tables) from the cases table and even removed the two tables (devices and investigators). I was not using them anyway, was trying to set them up before, but dropped the whole idea. So I removed them from the equation altogether. But still seeing the same error.

An additional note: I can make changes to EXISTING records and save them, but still cannot save NEW records."
Paul
Posts: 78
Joined: Mon Aug 25, 2025 6:03 am
Has thanked: 17 times
Been thanked: 2 times

Re: Javascript error when adding a new record

Unread post by Paul »

I got it working!

I failed to remove two columns related to the devices and investigators tables. Once I removed those as well as removing the devices and investigators tables, all is well. Geez.... I must sincerely apologize for the trouble and headaches I may have caused the both of you.
Moving on...

Update 9-26-2025 2:09pm
NOT fixed....now I get the same error as before when cloning a record...
Last edited by Paul on Fri Sep 26, 2025 11:10 pm, edited 1 time in total.
Paul
Posts: 78
Joined: Mon Aug 25, 2025 6:03 am
Has thanked: 17 times
Been thanked: 2 times

Re: Javascript error when adding a new record

Unread post by Paul »

I hate to bring the bearer of this news, but...this error has resurfaced.
Now it happens when I try cloning any record (not an object).
Uncaught TypeError: Cannot read properties of null (reading 'style')
at nuSetBrowseColumns (nuform.js?ts=20250926225156:4957:12)
at nuDragTitleEvents (nucommon.js?ts=20250926225156:2150:2)
at nuBuildForm (nuform.js?ts=20250926225156:145:2)
at Object.successCallback (nuajax.js?ts=20250926225156:193:4)
at c (jquery-3.7.1.min.js:2:25304)
at Object.fireWith [as resolveWith] (jquery-3.7.1.min.js:2:26053)
at l (jquery-3.7.1.min.js:2:77782)
at XMLHttpRequest.<anonymous> (jquery-3.7.1.min.js:2:80265)Understand this error
Paul
Posts: 78
Joined: Mon Aug 25, 2025 6:03 am
Has thanked: 17 times
Been thanked: 2 times

Re: Javascript error when adding a new record

Unread post by Paul »

I'm thinking of just re-creating this project from scratch...ouch.
steven
Posts: 396
Joined: Mon Jun 15, 2009 10:03 am
Has thanked: 58 times
Been thanked: 55 times

Re: Javascript error when adding a new record

Unread post by steven »

Paul,

I think we would all like that.


Steven
A short post is a good post.
Buy Kev a Coffee
Paul
Posts: 78
Joined: Mon Aug 25, 2025 6:03 am
Has thanked: 17 times
Been thanked: 2 times

Re: Javascript error when adding a new record

Unread post by Paul »

Gentlemen,

In the process of re-creating this database project, I found the culprit that has been plagueing me with the javescript error:

It was the DISPLAY object that I created to display the current record id in the form.
Namely, the SQL query:
select pk_inv_case_no from cases WHERE pk_inv_case_no = '#RECORD_ID#';

Once I deleted that object entirely, I could create and save new records, I could also clone existing records.

So what alternate way can I implement to display the current record id (in the EDIT form) without causing this awful problem?
Or should I be avoiding trying to do that?
The record ID does display in the main BROWSE form.
Case-ID.PNG
You do not have the required permissions to view the files attached to this post.
Post Reply