If that's your goal then it's very easy to do by adding the logic in the
form's __init__. Add/remove fields there and (possibly) override save()
if you have to take any additional action.
There's no need to do things like start modifying how the guts of
forms.Form works for something like this.
Shawn
If you want to change which widget is being used and where it's
displayed based on the checkbox then you'd have to use AJAX to make that
work "live" anyway. Or maybe have two form fields, one of each type, and
dynamically hide one and show the other when the checkbox is changed.
You could also use your form's clean() override to assign the correct
value to your form field.
Example:
Say you have a field named named 'reason,' and you want to make it
a select box with hard-coded choices if a boolean for is True, but a
free-form text field if it's False.
If you have fields named reason_select and reason_text, you could
use JavaScript to select the appropriate one to show based on the checkbox.
Then, in form.clean(), you use the value of the checkbox to
determine whether to fill self.cleaned_data['reason'] with the value
from self.cleaned_data['reason_select'] or self.cleaned_data['reason_text'].
I hope this helps. I think we're zeroing in on your solution.