Richard
|
| Posted: 11/12/2002, 2:22 AM |
|
Still looking for a way to disable or hide the button on formload, depending on the value in the text field. In other words if the field is empty I would like to have the button displayed so that the field can be updated. Once this button has been clicked it then needs to be disabled, so as it cannot be used to change the value in that field. That is part one. Part two is that on retrieving a record from the database if this field is populated from the database from having been clicked on a previous session I again would like to have the button either not visible or disabled. In short under any situation this button should only be available to be activated once when the field is null. If this field contains any value it should not be updateable at all. I imagine this is possible, just a small matter of working out how. I am currently using PHP / MS Access although soon going to PHP / MySQL. Any help much appreciated. Cheers
Richard
|
|
|
 |
RonB
|
| Posted: 11/12/2002, 3:13 AM |
|
If using javascript isn't a problem you could use javascript to check the value of the field and hide or show the button.
Ron
|
|
|
 |
Richard
|
| Posted: 11/13/2002, 1:34 AM |
|
As I am basically only familiar with PHP it may be a bit of a problem. Most of the javascript I have used on any of my pages I have copied from the various javascript sites, so I am not sure as to just how complex it would be to implement this across the site I am doing. If you can provide any assistance it would be much appreciated, and in the meantime I will scour the net to try to find some examples on how to utilise this method. Hopefully I will come up with something as it is beginning to become really frustrating. Cheers
Richard
|
|
|
 |
Lee Irving
|
| Posted: 11/13/2002, 8:26 AM |
|
The only way I have found is to put a label which has content type set to html
then before showing the label perform your test. If test succeeds set the label value to be the required HTML for displaying the button else set it to nothing.
Hope this helps. I could try and dig out a code sample should you still have difficulties.
|
|
|
 |
Nicole
|
| Posted: 11/14/2002, 6:53 AM |
|
Richard,
It is pretty easy with CCS. In form’s before show event check the fields value and set button’s Visible property to false. Also if you want to disable one of the common buttons (Insert, Update, Delete) you should disallow the corresponding operation.
Here is sample code:
global $form_name;
if ($form_name->email_subject->Value != "")
{
$form_name->Insert->Visible = false;
$form_name->InsertAllowed = false;
}
|
|
|
 |