>>>>e.g. if you want to extract certain text patterns from a text, regex not available
Perhaps you have figured this out already but...
Why not just perform this task from dbscripts.js ?
Unless I misunderstand something it sounds like it could be performed that way without too much coding. That is the idea of the dbscripts.js file.
For example: inside a text field "the red fox jumped over the lazy dog" to confirm "lazy dog" is contained in a column called f_111111 with a bit of js looking like:
var field = $('input[name="f_111111"]');
if (field.length) {
var fieldValue = field.val();
if (fieldValue.includes('lazy dog')) {
console.log('"lazy dog" is contained in the field f_111111');
} else {
console.log('"lazy dog" is not contained in the field f_111111');
}
} else {
console.log('Field f_111111 does not exist');
}
If you use the 'inspect' in your browser you will find the field id's and names and other attributes belonging to all of the elements on your form.
Use the name attribute rather than the id as per Kirill, the id is a sort of variable value and can not be assumed to be the same from one form render to the next.
'name' attribute can be accessed using jQuery library which is already loaded as part of TD environment so it would be addressed in this example as $('input[name="f_11111"]') where:
"$()" invokes the jQuery javascript library;
the CSS "selector" is '[name="f_11111"]' and the length property is used to check if the field exists. If length is returned as false it means the field is empty.
field.val() returns the content of the field to compare
if this result is compared to the target text using above example it returns true otherwise false.
The actual example as written displays the result in the inspection console of the browser.
This can be limited to look for the target text and field on specific forms using jQuery in a similar way and referencing the EDIT or VIEW of the table your form belongs to. That is found in the URL or also in the 'inspect' console at the top under the tag <body id= body_t_some#...>
Surround the code in a wrapper like this
if(jQuery("body#edit_t_yourTableNumberHere").length) {
...code from above goes here once it's adjusted for your case use...
}
This will only run it on the EDIT form of your target
if(jQuery('body#overview_t_yourTableNumberHere').length) {
... somthing like this would make it run on an overview page...like a dsahboard...
}
if(($('body#preview_t_yourTableNumberHere').length) {
...something like this would make it run on a preview form like a record details page...
}
This is the documentation for this type of solution.
https://www.teamdesk.net/help/database/resources/script-to-run-on-every-page-of-your-database/It may take a bit of trial and error to figure it out but it is very useful once you do.
Provides solutions to a lot of challenges.
Hope that helps Bernhard et al
I can try and offer more if you get confused or lost... feel free to reach out and I'll try if you need.