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.

Value not saved

Questions related to using nuBuilder Forte.
Locked
ltrannoy
Posts: 19
Joined: Sat Jul 26, 2014 10:09 am
Location: France

Value not saved

Unread post by ltrannoy »

Hello,

When I update the value of a field (fiedl02) from an event (onchange) of another field (field01), the value is displayed but is not stored in the database when the we submit the form.
Example :
Field01 field:
     onchange: $ ('# field02'). val ('TEST' ');
Field02 field:
   Display the value "TEST" correctly
Activation of the [Save] button
Result :
The value "TEST" is not stored in the table.

Thank you for your help.
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: Value not saved

Unread post by admin »

ltrannoy,

When did you find this happen?

When did you last update from Github?

Steven
ltrannoy
Posts: 19
Joined: Sat Jul 26, 2014 10:09 am
Location: France

Re: Value not saved

Unread post by ltrannoy »

My last update is 16 jan 2018.

thanks
pyro
Posts: 11
Joined: Wed Jan 17, 2018 7:06 pm

Re: Value not saved

Unread post by pyro »

Hi ltrannoy,

not really a solution but try to add the following code:

Code: Select all

function nuBeforeSave(){
return true;
}
I have the same issue with my datetime field https://forums.nubuilder.cloud/viewtopic.php?f=19&t=9255 however for some reason it works if I call the nuBeforeSave function.
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: Value not saved

Unread post by admin »

pyro,

I believe your problem was different, I've answered it here.. http://forums.nubuilder.cloud/viewtopic.php?f=19&t=9255

Steven
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: Value not saved

Unread post by admin »

ltrannoy,

I just wanted to know if it had anything to do with any changes I have made today.


Your question is a good one.

Your problem is that once you have updated a field with code, you need to run change() on the updated Object.

Code: Select all

$('# field02').val('TEST').change();
This lets nuBuilder know that this Object has been edited so that it will be saved.

(Only edited Objects are saved by nuBuilder)

Steven
ltrannoy
Posts: 19
Joined: Sat Jul 26, 2014 10:09 am
Location: France

Re: Value not saved

Unread post by ltrannoy »

Thanks for your help.

Laurent
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: Value not saved

Unread post by admin »

.
Locked