CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Forcing a form to error out

Print topic Send  topic

Author Message
Andrew B
Posted: 02/13/2002, 7:53 PM

I need to force a form to error out. I would like to just show an error message where the data for the form (a record) would be if the user had the proper rights. In this case, a user is not allowed to edit someone with permissions greater than his, and I would like to show that w/o an extra form and a lot more code than I already have.

I need to put code at the *very* start of the form, before the first 'if formErr=""' statement.

the 'form->before show' event of the form doesn't work, it's too late.
the 'form->form open' event is also run to late.

the 'page->open' event almost works. Unfortunatly the error field is reset to blank just after my code gets run.

Any clues anyone? AFAIK this would require CC to be modified in some fashion.
Nicole
Posted: 02/14/2002, 4:32 AM

Andrew,
try to use Validation event of the form and overwrite sFormNameErr variable there as well as put custom validation code.
Andrew B
Posted: 02/14/2002, 4:20 PM

I will give that a shot, but I don't think it will work. I want the form to error out before it opens. I realize now that what I was thinking of last night probably wont work. I wanted to replace the form itself with an error message, but I can't do that. What I was thinking of was kinda like the 'no records' message in a grid form. So, thanks for the reply but I think that what I was considering doing is not possible. I will go another route, possibly manually replacing the form with an error message (setvar "form", "error message") or hiding it and showing another form.

Thanks for the reply,
Andrew Backer
Brent
Posted: 02/14/2002, 9:42 PM

In PHP all you need to do is

die("<B>You should not be here.</B><BR>Press the BACK BUTTON to return from whence you came!");

You could put it in the PAGE OPEN event which executes right after the security check.
Of course the DIE command stops the page from displaying except for this message so the
user is sitting dead in the water (he can't bypass security).

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.