teke507
Posts: 69
|
Posted: 02/01/2007, 1:35 PM |
|
Is ther any built in function in CCS to Recall the last input value for a field from a record for example
First record
Make : HP
Model: D600
you add the record the form clears the what i would like to do is add a butten next to the record
----------------
Make : [ Last Input ]
----------------
----------------
Model : [ Last Input ]
You click on the last input button and it fills the field with the same content as the last submited record. I am a novice at php and scripting in general and I would like to find a way to do it through CCS...Thanks Again everyone for all your input.
-Anthony
----------------
|
|
|
wkempees
Posts: 1679
|
Posted: 02/01/2007, 3:15 PM |
|
Check the Help or Docs fot the AfterInsert or even BeforInsert events.
In your example you could set two sessionvars or even directly set to screenlables with the data you just submitted or are about to submit.
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
|
|
|
dharma
Posts: 11
|
Posted: 02/05/2007, 5:00 AM |
|
Try this
//Custom Code @30-2A29BDB7
global $Redirect;
//Below is the name of the DB CONNECTION. Not the name of the DB itself.
global $DBShowSched;
//Retrieve the last inserted key
$LastID = CCDLookUp("last_insert_id()","performer","", $DBShowSched);
//Append the last inserted key to the URL by modifying the 'Redirect' variable
$Redirect = "show_maint.php?".CCAddParam(CCRemoveParam(CCGetQueryString("QueryString", "ccsForm"),"ccsForm"), "performer_id", $LastID);
//End Custom Code
or try this
//Custom Code @259-35B0037F
// -------------------------
global $show_contact;
global $Redirect;
// Write your own code here.
if(!CCGetFromGet("performer_id",0)) {
$LastID = CCDLookup("last_insert_id()","performer","performer=".$DBshowsched->ToSQL(CCGetFromPost("performer",""),ccsText),$DBshowsched);
if (strpos($Redirect,"?") == false ) {
$Redirect = $Redirect."?performer_id=".$LastID;
} else if (substr($Redirect,-1) == "?" ) {
$Redirect = $Redirect."performer_id=".$LastID;
} else {
$Redirect = $Redirect."&performer_id=".$LastID;
}
}
// -------------------------
//End Custom Code
_________________
Regards & Tq
____________
Dharma Mulya
www.malaysianportal.com |
|
|
|