This topic is locked

Require Fields on Advanced Search

8/21/2015 11:19:41 AM
PHPRunner General questions
J
jetacera author

I am needing to require fields when a user completes the Advanced Search form. They must complete 4 of the 5 available fields: state, city, zip, and address. The city is a dropdown dependent upon state. Zip is a dropdown dependent upon city. Address is a text field. How do I force the user to complete the 4 fields? I am using PHPRunner 6.0. I'm sure there must be some type of event code for this.
Thank you.

Sergey Kornilov admin 8/24/2015

In PHPRunner 8.0 and later you can make search fields required. In PHPRunner 6.0 there is no easy way to do that.

J
jetacera author 8/24/2015

OK, so if I were to upgrade to version 8, will it convert my version 6 phpr file? This is on a project that is enormous (40 database tables with multiple views of several of them which generates over 1700 files on build). It took me about 2 months to get it programmed in version 6, so I cannot reasonably redo the whole thing in a new version.
I just need to require these 4 fields on advanced search on two sections (same fields names, different database tables/views). I don't want them to only use one field on search and have it reveal more information. (We don't want them to see every record for the entire state or the entire city just by selecting only one of those fields to search. They need to enter the address to limit their search results or the purpose of that view/section is defeated.)
I'm OK with a complicated event code if that is what is necessary. It's OK if when they don't use all 4 fields that it would throw an error or something just as long as they don't see results when they don't use all 4 fields. Any alternative ideas is also appreciated.

Sergey Kornilov admin 8/24/2015

It really depends on details of your project. Try it with the trial version first to see for yourself.