how to disable the posting button in the sales order header form for a particular condition

Hi,

In the sales line table i am adding new field i.e DocumentLineStaus and it is a Enum and it contain the parameter values as NONE, PENDING,CANCEL then it will be add to the sales order form .sales order form–>in the Lines–> genreal–> add the document line status field.

Now my requirement is in the sales order form when ever i am setting document line staus field is NONE at that time only posting the sales order, When ever i am setting the doucment line status field is Pending at that time that line will posted with Quanity is 0,when ever i am set the Cancel at that time posting button will be disable .supose i am try to posting at that i want only NONE status lines posted

how it is possible?