parsing error unexpected token on Client Script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2021 03:05 PM
Hi
I am abit of an issue with onSubmit Catalog Client Script it is advising me there is an parsing error unexpected token at the end of the script. Any ideas on this
function onSubmit() {
//Type appropriate comment here, and begin script below
var reg = /^[\d]{6}(?:(,?|)(?:[\d]{6}\1)*[\d]{6})?$/;
if (!reg.test(budget_holder_cost_centres_1))
{
}
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2021 03:09 PM
If this is the entire script, then it is missing a closing }
.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2021 04:48 PM
Hi, your script does not appear to reference your data, I assume the source is a form field?
var myField = g_form.getValue('budget_holder_cost_centres_1');
var reg = /^[\d]{6}(?:(,?|)(?:[\d]{6}\1)*[\d]{6})?$/;
if (!reg.test(myField))
{
}