Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Save the time of pressing the button on the form.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 446 times
- Contact:
Re: Save the time of pressing the button on the form.
You can also add debugger; before calling nuSaveAction(); to check if the function gets called.
(Developer Console needs to be open)
(Developer Console needs to be open)
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Save the time of pressing the button on the form.
I see the 'Save' button turns red and the message of the 'Recording saved' window, the button turns blue, the time appears for a second and disappears.kev1n wrote:You can also add debugger; before calling nuSaveAction(); to check if the function gets called.
(Developer Console needs to be open)
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 446 times
- Contact:
Re: Save the time of pressing the button on the form.
When you use JS, don't forget to add .change(), otherwise the field won't be saved in the db.
E.g.
E.g.
Code: Select all
$('#your_time_field').val('your time').change()
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Save the time of pressing the button on the form.
Of course the function is written this way.kev1n wrote:When you use JS, don't forget to add .change(), otherwise the field won't be saved in the db.
E.g.Code: Select all
$('#your_time_field').val('your time').change()
function getCurrentTime() {
var d = new Date();
var df =
nuPad2(d.getHours()) + ':' +
nuPad2(d.getMinutes());
$('#ves_vr').val(df).change();
}
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 446 times
- Contact:
Re: Save the time of pressing the button on the form.
What input format does ves_vr have?
Is the time saved if you execute getCurrentTime() in the developer console and then click on the form's Save button?
Is the time saved if you execute getCurrentTime() in the developer console and then click on the form's Save button?
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Save the time of pressing the button on the form.
I don't need the user to select and save time. I need to know the moment at what time he took the readings to write the data to the database.kev1n wrote:What input format does ves_vr have?
Is the time saved if you execute getCurrentTime() in the developer console and then click on the form's Save button?
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 446 times
- Contact:
Re: Save the time of pressing the button on the form.
This is just to test if saving works in general.
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Save the time of pressing the button on the form.
After executing getCurrentTime in the console and pressing the red button, the value disappears.kev1n wrote:This is just to test if saving works in general.
-
- nuBuilder Team
- Posts: 4305
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 446 times
- Contact:
Re: Save the time of pressing the button on the form.
Please check that and also the db column type.kev1n wrote:What input format does ves_vr have?
-
- Posts: 366
- Joined: Sat Apr 11, 2020 12:03 am
- Has thanked: 3 times
- Been thanked: 4 times
- Contact:
Re: Save the time of pressing the button on the form.
kev1n wrote:Please check that and also the db column type.kev1n wrote:What input format does ves_vr have?
You do not have the required permissions to view the files attached to this post.