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.
|
|
|
|