Click to See Complete Forum and Search --> : how to not submit?? help!


mppavlov
02-22-2005, 09:25 AM
Hi,
Bascially i have written a cgi script to work with dbi. I have one page with the options from which the user selects the ones to search the database for. This page has a submit button-which when pressed displays the results from the database. However i need the program to work so that if the user selects no options-when the submit button is pressed-it does not display the results page- but stays on the same (initial search) page.
Any help is gratefully accepted.

the code is basically these 2 parts:

unless(param()) {
{blah blah options code}
submit,
end_form,
hr;
}

if(something){

print results
}

NogDog
02-22-2005, 10:55 AM
Usually what I do is something like:

if(all required fields filled in)
{
process request and display results
}
else
{
display an error message page with a link back to the input page
- OR -
redisplay the input page with a descriptive error message near the top
}