Brian
|
| Posted: 09/18/2004, 10:01 PM |
|
Hello,
I made a page with 2 records on it. In the BeforeShow event of a page I choose which record to use depending on a database query. Everything seems to work but my one record (USERS2)won't display the Update Button. I finally got everything the way I want it but now I can't figure out why the Update button would disappear. thanx for any help. Here is the code
global $forgotpassword;
global $DBTripRealty;
global $users;
global $users2;
global $Tpl;
if(!strlen(CCGetParam("active_key", "")) && !strlen(CCGetParam("email", "")))
{
$NotValid = "You don't have permission to view this page";
$Tpl->SetVar("NotValid", $NotValid);
$users->Visible=false;
$users2->Visible=false;
}
$ckdb = new clsDBTripRealty;
$ckdb->connect();
$SQL = "SELECT user_id, security_question_id, security_question_answer FROM users WHERE active_key=" . $ckdb->ToSQL(CCGetParam("active_key", ""), ccsText) . " AND email=" . $ckdb->ToSQL(CCGetParam("email", ""), ccsText);
$ckdb->query($SQL);
$Result = $ckdb->next_record();
if(!$Result){
$NotValid = "You don't have permission to view this page";
$Tpl->SetVar("NotValid", $NotValid);
$users->Visible=false;
$users2->Visible=false;
}
if($Result){
$security = array(
"security_question_id" => $ckdb->f("security_question_id"),
"security_question_answer" => $ckdb->f("security_question_answer")
);
if(strlen($security["security_question_answer"])){
$users2->Visible=false;
}else if(!strlen($security["security_question_answer"])){
$users->Visible=false;
$users2->UpdateAllowed = true;
}
}
|
|
|
 |
Brian
|
| Posted: 09/20/2004, 10:04 AM |
|
Is it possible to have to update grids on one page? My one update record is working fine but the other one won't display the submit button. How can I fix this. Thanks
|
|
|
 |
klwillis
Posts: 428
|
| Posted: 09/20/2004, 1:12 PM |
|
Sometimes, the actual HTML for the form can get modified
when moving rows around, changing templates, etc..
Make sure that your second form contains the '<form ...>' tag,
and that the operation for your submit button is set to Update.
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
 |
 |
Brian Kestenholz
|
| Posted: 09/20/2004, 2:56 PM |
|
I checked my HTML and everything looks formatted correctly. Both forms and records are closed properly. I also verified that the form was set to update.
I finally got it working properly by altering the main file:
$this->Button_Update2->Visible = $this->EditMode && $this->UpdateAllowed;
And manually setting it to:
$this->Button_Update2->Visible =true;
For some reason it appears that either the $this->EditMode or $this->UpdateAllowed are not set to true. Why would this be? I can use it as, but if I do any updates within the file it won't work until I change the main file back. I would like to fix it so it would always work..
Thank you for any additional help....
|
|
|
 |
klw
|
| Posted: 09/22/2004, 10:26 AM |
|
You shouldn't have to manually set your update button to visible.
Are the 'Allow Insert', 'Allow Update' and 'Allow Delete' properties
set for the form?
|
|
|
 |
|