Basically, I need to change the value of a database field before it is displayed in an edit form.
For, examle, I might set a date to the current date (say, as a last modification date)
I can set a default value for a new record easilly, but can't figure out how to do it on an existing record.
Agnar
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.
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.
Change a database value before display
-
- Posts: 503
- Joined: Thu May 24, 2012 2:08 am
- Location: Milan, Italy
- Contact:
Re: Change a database value before display
Agnar, you could use nuLoadThis() function in Custom Code > Javascript.
For example:
If the field isn't on the form you can:
Hope this helps,
Max
For example:
Code: Select all
if ( $("#your_field").val() === '' ) {
$("#your_field").val('default value');
}
- use AJAX call to get the value from DB;
- load the value field in a hidden field on the form.
Hope this helps,
Max