This topic is locked

advanced search restriction

6/23/2010 5:30:33 AM
PHPRunner General questions
B
bashar author

Hello,
I wonder if there is a way to make the search NOT possible if the search field is empty in advanced search.

I have checked the "required filed" check box in the visual editor but it didn't work. Any help is very much appreciated.
Thanks.

J
Jane 6/24/2010

Hi,
'required' option works on the add and edit pages only.

To check values on the advanced search page add custom JavaScript code for the 'Search' button. UseSearch page: Before display event on the Eventstab for this purpose. Here is a sample:

$xt->assign("searchbutton_attrs", "onClick=\"javascript: if (!document.getElementById('value_FieldName_1').value) {alert('FieldName is required'); return false;} searchController1.submitSearch();\"");