This topic is locked

How to avoid empty search?

6/6/2008 6:43:30 AM
PHPRunner General questions
E
everyday_ author

hi,

how to avoid user from searching an empty string? when user click search button without entering any data, it seems like all data will pops out in the table. how to disable it?

J
Jane 6/7/2008

Hi,
try to use following code in the List page: Before SQL query event on the Events tab:

if (@$_REQUEST["a"]=="search" && !@$_REQUEST["SearchFor"] && !@$_REQUEST["SearchField"])

$strWhereClause = whereAdd($strWhereClause,"1=0");

E
everyday_ author 6/7/2008

thank you.. although this question already been answered before. I'm a little confused with the question that were asked by Rei. thanx again <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=30101&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />