I have a checkbox and if I tick it I want a textfield to become enabled (disabled as default) and when I untick the the checkbox I want it to become disabled again.
Here's a page that does what you're looking for - it's pretty minimal but shows what you need