CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Editable Grid - always adds empty record when submitting

Print topic Send  topic

Author Message
FERAD

Posts: 51
Posted: 08/09/2006, 6:10 AM

I have an editable grid with 3 empty rows. No data has been entered or changed. If the submit button is pressed, it adds a new record to the database regardless. How can I control whether a record is to be updated or not.

I have even added to the Before Build Insert event the following code:
$items->InsertAllowed = false; (php)

I wanted to see if this would stop the blank record from being inserted but it always inserts 1 record.

Your help would be greatly appreciated, thanks in advance.
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 08/09/2006, 6:17 AM

FERAD
By any chance does your editable grid have default values set?? Are you validating your input fields??
View profile  Send private message
FERAD

Posts: 51
Posted: 08/09/2006, 6:23 AM

All the fields are blank with no defaults. If I add a default value to any of the fields I get 3 records added instead of 1. This is because I show 3 blank rows. If I change the number of blank rows to 1, I still get 1 recorded added regardless of the number of blank rows.
View profile  Send private message
mamboBROWN


Posts: 1713
Posted: 08/09/2006, 6:31 AM

FERAD
Are you validating your fields to see if they are empty??
View profile  Send private message
FERAD

Posts: 51
Posted: 08/09/2006, 6:44 AM

No Validation
View profile  Send private message
jres
Posted: 08/09/2006, 7:04 AM

FERAD,
do you use checkbox in row?
FERAD

Posts: 51
Posted: 08/09/2006, 7:09 AM

All the fields are textboxes with one listbox (no value selected). When I check the database all fields show NULL value. The only thing with the database is there is one autoincrement field. I even changed the listbox to textbox as well.... same problem.
I even tried to remove the autoincrement field from the database... same problem.
Setup Custom Insert for the table. This worked.

Thanks for the responses.
View profile  Send private message
jres
Posted: 08/09/2006, 8:53 AM

I understand your initial problem:
$items->InsertAllowed = false;
can't be used in BeforeBuildInsert event
you can use it in BefoeInsert event or onValidate event.

Add new topic Subscribe to topic   


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.