- November 8, 2016 at 11:56 am #10769
I’m using ASP on our site so that people can find the pages of our ‘workers’ by means of POSTAL CODE. (We had a mail conversation about this before I bought the plug-in). It works OK, but even though I state on the site and even in the search bar that people only have to fill in the digits of their postal code (so NOT the letters) there are people who don’t read and they fill in their whole code – and that will not give results. I am not planning to type all the possibilities of our postal code in the Netherlands so I’d rather have the possibility that people can only use 4 letters in their search. Is that possible? I couldn’t find it in the documentation, but maybe I overlooked it?!
Ideal would be a small search bar with no looking glass – only fill in 4 digits and then…. bam, to the page.
Any help will be greatly appreciated,
Josh HaijerNovember 8, 2016 at 1:32 pm #10772
Well, there are no options to limit the maximum length nor the character input to numbers only, but it’s possible with a small custom script without touching the plugin code.
Put this code into the functions.php file in your active theme directory (start copy from line 3):
This will execute a small code snippet on page load, which validates the input for number only, and maximum length of 4.
You also mentioned, you don’t need the magnifier, you can hide that on the Theme Options -> Search Text button panel: https://i.imgur.com/iWE3bAB.png
(I’ve placed that option accidently to the wrong panel)
I hope this helps!Best,
If you like my products, don't forget to rate them on codecanyon :)
You must be logged in to reply to this topic.