code to calculate strings into a field
Posted: Fri Aug 14, 2020 2:58 pm
I thought this would be easier than it seems to be!
im trying to take a date of birth and initials and create a unique code to also identify a client (for use by people). this is automaticly generated when adding the clients details.
the following code works, in that it puts the code into the easycode field (ive tried text input and textarea and calculated fields), but DOESNT save to the database UNLESS you go into the easycode field and edit it
after entering the persons date of birth, i used the customcode on event =onchange
var dobval = document.getElementById("cli_dob").value;
var doini = document.getElementById("cli_ini").value;
var dobstr = dobval.toString();
var dobday =dobstr.charAt(0)+dobstr.charAt(1);
var dobyr = dobstr.charAt(8)+dobstr.charAt(9);
var make =document.getElementById('cli_easycode').value;
var all=doini+dobday+dobyr;
cli_easycode.value = all;
cli_easycode.value = cli_easycode.value;
how do you get the stored value (which shows up in the field) to update the database? (ive tried a few different methods)
many thanks
im trying to take a date of birth and initials and create a unique code to also identify a client (for use by people). this is automaticly generated when adding the clients details.
the following code works, in that it puts the code into the easycode field (ive tried text input and textarea and calculated fields), but DOESNT save to the database UNLESS you go into the easycode field and edit it
after entering the persons date of birth, i used the customcode on event =onchange
var dobval = document.getElementById("cli_dob").value;
var doini = document.getElementById("cli_ini").value;
var dobstr = dobval.toString();
var dobday =dobstr.charAt(0)+dobstr.charAt(1);
var dobyr = dobstr.charAt(8)+dobstr.charAt(9);
var make =document.getElementById('cli_easycode').value;
var all=doini+dobday+dobyr;
cli_easycode.value = all;
cli_easycode.value = cli_easycode.value;
how do you get the stored value (which shows up in the field) to update the database? (ive tried a few different methods)
many thanks