ckroon
Posts: 869
|
| Posted: 01/07/2011, 12:25 AM |
|
Hi Al..
I have an image link on a form that is a Delete Link.
It goes to another page where it goes through a bunch of checks prior to deleting a record.
I need this image link to be hidden unless the form is in Update mode.
I figured the easiest thing would be to hide show depending on a url variable (pid), if pid >=1 its an update and I want the button there... if pid <1, its an ADD and the button should hide.
On the BS event of the form I have this code:
$Form1->DeleteButton1->Visible = True;
$get = CCGetFromGet("pid","");
if ($get >= 1 )
{
$Form1->DeleteButton1->Visible = False;
}
but it is not hiding when pid >=1
Any ideas?
_________________
Walter Kempees...you are dearly missed. |
 |
 |
Waspman
Posts: 948
|
| Posted: 01/07/2011, 12:44 AM |
|
Have you set the image links visible property to dynamic?
_________________
http://www.waspmedia.co.uk |
 |
 |
datadoit
|
| Posted: 01/07/2011, 6:49 AM |
|
Perfect place to use the Hide/Show Component Action.
Instead of selecting Custom Code, choose the action.
Component Name: DeleteButton1
Action: Hide
Condition Type: Expression
Compare As: Text
Condition: CCGetParam("pid","") >= 1
|
|
|
 |
ckroon
Posts: 869
|
| Posted: 01/07/2011, 8:35 AM |
|
Doh!
Thanks! Works great now
_________________
Walter Kempees...you are dearly missed. |
 |
 |
datadoit
|
| Posted: 01/07/2011, 9:10 AM |
|
Since you merely want to check if the form is in update mode...
Component Name: DeleteButton1
Action: Hide
Condition Type: Expression
Compare As: Text
Condition: !$Container->EditMode
|
|
|
 |
ckroon
Posts: 869
|
| Posted: 01/13/2011, 8:08 AM |
|
awesome Data.. thanks!
_________________
Walter Kempees...you are dearly missed. |
 |
 |
damian
Posts: 838
|
| Posted: 01/21/2011, 10:54 PM |
|
definitely the latter option would be best...
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |