Just curious, though; does Wix find this acceptable?
Does Wix find what acceptable? Not sure what you mean specifically.
I was wondering if Wix finds it acceptable that a valid regular expression doesn’t work in their text input settings and that we’re forced to go with JavaScript solution.
It does in some cases and not in others. As I mentioned to you earlier in the thread. When I exited the editor and re did the regexp binding (removed it, saved the page, added it again. It eventually worked so it probably has something to do with the state of you browser session. If you are using chrome, for instance, edits might not work but they might in firefox or safari. Sometimes it takes trial and error OR just going to code as we did ;-).
If you can reliably recreate the problem then its worth creating a new post to share the specifics and use the words “regexp validation bug on TextInput element binding” in the subject line this will get their attention.
Hey @abergquist,
Do I find it acceptable? Why not? Although, if you buy me a beer I might step up and display some righteous indignation.
Hope you guys don’t mind me joining in on the fun. I took a look at your site @abergquist, and you’ve got an error in the page’s onReady() function:
This what you have:
$w(“input1”).setFocus();
and it should be:
$w(“#input1”).focus();
-
Component IDs require a hashtag.
-
There is no setFocus() function.
Perhaps this causes the problem? I tried a few times and it seems to work just fine each time I submit. What’s puzzling is that it even works with the error above.
Do you see the problem in both Preview and Live?
Yisrael
Hi Yisrael:
Good catch but I am not sure that the onReady error would have an impact on an element binding regexp configuration (but stranger things have happened!).
The fact that the problem went away and the zip code test started to work when abergquist removed the regexp binding and replaced it with an onCustomValidation handler suggests a bug in the regexp processing of the textInput settings dialog.
I say suggests because of course the problem needs to be recreatable to verify and debug. I created my own page with a similar regexp setting and experienced the same problem. It went away after ‘playing’ with the field, setting it and resetting it saving and publishing a number of times along the way. If I can recreate the problem I’ll let you know!
Alright, you two; I’ll buy you BOTH a beer (stcroppe, you get at least 2 from me). Thanks; I really do appreciate all the help you have both given me!
I used to have a sign on my desk - will work harder for beer
Cheers
@stcroppe , You “used to have a sign”? What happened - you don’t work hard anymore?
Hi Yisrael:
I try not too hard anyway ![]()
I swapped it for “Mine’s a Vodka Martini shaken not stirred (preferably made with Absolut Peppar)”
Ask Idan ;-).
So now you’re upping the ante from beer to martini?
Hmm, I’m sticking with beer. I consider it a productivity tool.
@abergquist Actually, I am fine with beer so long as it’s real beer. We Brits are particular about our ale ![]()
So now we have to go with ale vs. beer; I see how it’s going to be
Guinness!!!
And I agree - only real beer: Reinheitsgebot
Hi, Steve.
I implemented the custom ZIP Code validation you recommended:
$w(’ #zipCode ‘).onCustomValidation((value, reject) => {
console.log(JSON.stringify($w(’ #zipCode ‘).validity));
let regExp = new RegExp(’[1]{5}$');
if (!regExp.test(value))
{
reject(‘Bad Zip Code’);
}
else
{
console.log(‘good zip code’);
}
});
If I enter an invalid ZIP Code (e.g., ‘1’), Wix correctly outlines the ZIP Code input box in red but when I hover the mouse over the ZIP Code input box, I don’t see the ‘Bad Zip Code’ tool tip I would have expected to see.
0-9 ↩︎
Hi Abergquist:
There isn’t a tooltip that comes with the inputElement from what I can see. It may be a side effect of using the validation in the inputElement. What you probably need to do is create a text box that is hidden and shows when you change the zip code value or hover over the zipCode element.
Take a look at this sample page:
Steve
I may be having the same issue, but with one twist… the page that is offending is an exact copy of 2 other pages that work well. The only difference these pages have is the token I use to submit which of the 3 pages the end user landed on (based on a selection on a previous page). I used a checkbox with one option named by the page. THis has plagued me for an entire weekend and I am not familiar with the logs. Could you possibly help me?
hi i am having a bit of a issue with saving my data. i get the error that it couldn’t get saved. everything was working but than i added some code and now the publish version isn’t working anymore. when i try it in the editor i can see it save but not when i am testing it in the publish mode.
can somebody help me?
Can you start a new post ? It isn’t obvious that this is the same issue and burying the answer in this post will make finding the answer tough! Cheers

