Page 1 of 1

Refresh display field

Posted: Wed Dec 14, 2016 5:22 pm
by mobilemcclintic
Hello,
I am just now exploring JavaScript and events (Exciting for me and my users), and I have started adding functions that change fields depending on selections as they are done instead of running After Save queries.
I have a dropdown box that a user selects Yes, No or Pending with the dropdown field using "|Pending|1|Yes|0|No".
This dropdown has an onchange event on it that changes a date field, which works great.
I also have a display field somewhere else on the form that shows P, Y, N depending on what is saved for the record. I am using this code "select if('#slstoquote#' = '1','Y',if('#slstoquote#' = '0','N','P'))"
I am wondering if there is a JavaScript code that will force an update on the display field so when a user changes the dropdown box, not only does the date field populate, but the display field updates as well.

Love nuBuilder by the way. Except, every time I learn something new that is more efficient, I get to go through and recode/migrate everything...which I suppose is good experience for other projects and also gives me better arguments to rip apart another access database ;)

Re: Refresh display field

Posted: Wed Dec 14, 2016 7:47 pm
by mobilemcclintic
Probably not the best way, but since I only had 3 static options in this particular display field, I added
$('#dispQYN').val('N').change();

to my function to get my result to show in the display field onchange of the real field's dropdown.

Re: Refresh display field

Posted: Tue Jan 24, 2017 2:55 am
by admin
mobilemcclintic,

I'm not sure I understand your question...

If you have a field called invoice_total

you can update it with $('#invoice_total').val(123.45);

(But you knew that).

Steven