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

 Default Value

Print topic Send  topic

Author Message
RacerX

Posts: 8
Posted: 04/25/2010, 10:04 PM

Hi, I'm new to CCS and PHP, my question is in an editable grid how can I set the default value to the URL parameter of a textbox IE: Client ID text box fro a new record should default to 12 because the url is Client.php?ClientID=12
View profile  Send private message
Waspman

Posts: 948
Posted: 04/26/2010, 12:45 AM

You can add a before show action to retrieve value for the control, however this is an editable grid and any empty rows will also have the corresponding field populated. Youll end up with lots of unwanted records.

So in the Before Build Insert event of the grid put this...

if ($Container->One of your other fields->GetValue()=='') {

// the field is empty so don't save this record
$Container->InsertAllowed = false;

} else {

//record is added,

$Container->InsertAllowed = true;
$Container->DataSource->ClientID->SetValue(CCGetFromGet("ClientD", ""));
}

HTH...T
_________________
http://www.waspmedia.co.uk
View profile  Send private message
ckroon

Posts: 869
Posted: 04/26/2010, 12:45 PM

In the Before Show Row Event

$ get = CCGetFromGet("ClientID","");

$Container->clientid_field->SetValue($get);

_________________
Walter Kempees...you are dearly missed.
View profile  Send private message

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.