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