CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Insert Button Removed - PHP

Print topic Send  topic

Author Message
triptaker
Posted: 10/31/2003, 6:58 PM

Hi,

I am using the Before Insert event to check if any errors exist before I insert a row into my database. If an error exist, I want to prevent the insert and return the user to the page with an error. I used the following code:

if($error)
{
$reservation1->InsertAllowed = false;
$reservation1->Errors->addError($error);
}

It prevents the insert and displays the error but it removes the insert button when the page reloads. How can I prevent the insert from occuring but have the Insert button remain.

Any help would be appreciated.

Thanks,

Brian
Karen
Posted: 10/31/2003, 11:44 PM

Try using the form's Server On Validate event to stop the insert instead. You don't have to disallow insert, just have to add error and that will stop the insert. To do the validation only for insert, have a condition that checks whether it is insert or update, I believe that's <form>->EditMode.

Hope that helps.

   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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