Shopping Cart Operations > Built-in Features

Conditional options?

<< < (2/2)

rnkwoodworks:
Ok I found this elsewhere on the web and it seems to work. Just posting it for anyone else that might need similar down the road. Perhaps there are things in this Regex that will prove problematic but it's on the right track.

/^(?:\w+\W+){0,1}(?:\w+)$/

Replace the "1" in {0,1} with the number of words you want to allow over the first. In other words mine allows 2 words. To allow 6 words, change the 1 to a 5 like {0,5}

Basara:
Thank you rnkwoodworks

rnkwoodworks:
Issue... the above regex only allows ordering IF you input two words into the option. If not, it rejects the order. Same happens if I put a regex into the 10 word option.

I thought if an option wasn't marked required, the regex wouldn't even come into play?

Sorry about all this.

Navigation

[0] Message Index

[*] Previous page

Go to full version
Powered by SMFPacks Social Login Mod