Enable button based on condition

I posted a solution to this problem here.