Just like a field or layout text, you can use conditional formatting to control the text and fill color of the button. This is often used in Filemaker to change the text color to grey when a button needs to be displayed as "disabled". Please note that the formatting does not control the function of the button--just it's appearance--the button's script has to include code that keeps the script from executing when it is "disabled" as well.
You can do even more dramatic things with your buttons by using portals, a tab control or a calculation field that returns the contents of 2 or more container fields to make the appearance of the button change completely or even make it disappear entirely.
What would i insert into the script then so that it would disable it?
You can't really disable it. You just include the script steps inside an IF EndIF block so that nothing happens when the button is clicked in its "disabled" state. The if step uses essentially the same boolean expression as the conditional format.
Say you disable a button by setting a global variable $$ButtonOff to true.
The conditional format expression can be simply $$ButtonOff and specify a grey text color.
Your button's script would look like this:
If [not $$buttonOff]
// steps to what you want to take place when button is not disabled go here
Thank you very much. You have no idea how much this helps.