RoyBaird
Posts: 115
|
| Posted: 08/29/2008, 10:37 AM |
|
I have an editable grid that I populate one of the fields from a session variable. I am using auto-new-row code to give me a new row when the current is filled. The problem is when submitting, I get an extra record with only the field I populated filled in. There are several ways to stop this, but I am not a PHP programmer. Any suggestions on how to check for an empty field and not insert a record?
Thanks,
_________________
Roy |
 |
 |
wkempees
Posts: 1679
|
| Posted: 08/29/2008, 4:25 PM |
|
Roy,
Your requirement is described here:
Help file, Search: Prevent Operation individual Editable Grid
So, in your editable grids Before Execute Insert
(In Design Click the E.Grid, Properties, rightclick the event, choose CustomCode)
enter the following code, replace 'fieldname' by the name of your textbox
if ( !$Component->fieldname->GetValue()) {
$Component->DataSource->CmdExecution = false;
}
In the Helpfile you see $Task mentioned, however the better method is to use $Component
(in this case very handy) to refer to the current component (handy because I do not know your Component's name as you did not mention gridname, datasourcename nor fieldname to be tested).
Quote :
am not a PHP programmer
resulted in maybe patronizing (not intended) elaborate explanation.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
|