Gossamer Forum
Home : Products : DBMan : Customization :

adding or searching

Quote Reply
adding or searching
is it possible for sub build_html_record_form to know how it was called? i want to add an indication of required fields in autogeneration of forms for adding and modifying but don't want the indicator to appear in the search form. if there is a way to test whether it was called from search form or not, i could bypass the code for searches. hope this makes sense.
Quote Reply
Re: [delicia] adding or searching In reply to
Below is from db.cgi.

So to try and answer your question, yes you can evaluate the $in{} to see what the user requested.

Code:
# Main Menu. Check to see what the user requested, then, if he has permission for that
# request, do it. Otherwise send the user off to an unauthorized request page.
if ($in{'add_form'}) { if ($per_add) { &html_add_form; } else { &html_unauth; } }
elsif ($in{'add_record'}) { if ($per_add) { &add_record; } else { &html_unauth; } }
elsif ($in{'view_search'}) { if ($per_view) { &html_view_search; } else { &html_unauth; } }
Quote Reply
Re: [joematt] adding or searching In reply to
yes, i saw that code and tried it, but it didn't seem to recognize it. i'll try again.

edit: it works -- i had tried 'add_record' instead of 'add_form' earlier. now it works great!

Last edited by:

delicia: Jul 31, 2003, 11:27 AM