Is there a way to set the minimum search length for a custom search box within Weblink? I do see the option for the maximum length. Thanks.
Maximum Length:
Is there a way to set the minimum search length for a custom search box within Weblink? I do see the option for the maximum length. Thanks.
Maximum Length:
This issue is fixed in WebLink 9 SP1. Please see KB 1013665.
There is a way to set minimum length, but you have to do it through the search HTML code. After saving the search, go to your WebLink directory and navigate to WebLink\Web Files\searchforms\[repository]\[search name].XML where you open the folders for the repository you set the search up for and open the XML file for the search you want to modify. In the top section, look for <UI> and then underneath find the <label> for the field you wish to apply a minimum value to. To set a minimum value, add the pattern parameter to <input /> to require the user input to be between a certain number of characters. The snippet below requires a minimum of 3 characters and doesn't have a maximum.
<input runat="server" id="Test_Input0" resetval="" pattern=".{3,}" />
A couple things to consider
1) Making subsequent changes to this search form will save over your customizations so make sure to finish the search form completely, and then go add this minimum value requirement. Also, make a copy of the XML file so if anything does get changed from the search form UI, you have your customizations still.
2) There are a few ways to let your users know about this minimum requirement, but the easiest would be to put it in the label on the search form. For example, name the first field "Probation ID (please input at least 2 characters)" or add the part in parentheses somewhere.
3) This solution worked for me in Chrome, but it is not guaranteed to work in all browsers. Different browsers have different support for HTML5 so there might be places where it won't work. If it isn't working for you, try it in different browsers.