title: if statement in Django crispy form, conditional form layout
body: <p>I have a Django crispy form: A typical sign up form with email address, password field and submit action. </p>
  
  <p>I have a hidden field passed to the Django crispy form from my urls python file called 'billing_secret". The billing secret is different for different URLs.</p>
  
  <p>objective:
  To have a terms and conditions radio checkbox enable/disable the submit button for a specific billing secret, consequently url. </p>
  
  <p>I need to add 2 things.</p>
  
  <ol>
  <li>Add an if statement within the Crispy form to only show a Radio checkbox for a certain billing secret. For example, if the billing secret is "apples" <strong>show</strong> radios and default to "no". If the billing secret is anything else make the radio hidden, default to yes.</li>
  </ol>
  
  <p>This is what I have so far (doesn’t work). Apologies I’m completely new to Python.</p>
  
  <pre><code>email = forms.EmailField(label=_("Email"))
  password1 = forms.CharField(widget=forms.PasswordInput,label=_("Password"))
  billing_secret = forms.CharField()
  termsandcond = forms.TypedChoiceField(
          label = "Do you agree to the T&amp;C's?",
          choices = ((1, "Yes"), (0, "No")),
          coerce = lambda x: bool(int(x)),
          widget = forms.RadioSelect,
          initial = '0',
          required = True,
      )
  
  def __init__(self, *args, **kwargs):
      billing_secret = kwargs.pop('billing_secret', None)
      super(RegistrationForm, self).__init__(*args, **kwargs)
      self.helper = FormHelper()
      self.helper.form_method = 'post'
      self.helper.form_action = '.'
  
      self.helper.layout = Layout(
          Field('email', placeholder=_("Email")),
          Field('password1', placeholder=_("Password")),
          Field('billing_secret', value=billing_secret, type="hidden"),
  
          if billing_secret is 'apples':
              return InlineRadios('termsandcond'),
          else:
              return InlineRadios('termsandcond', initial="1", type="hidden"),
  
          Submit("save", _("Get Started"),css_class="pull-right"),
      )
  </code></pre>
  
  <ol start="2">
  <li>Disable the submit button when the radio buttons value is  ”no" and enable when "yes". </li>
  </ol>
  
  <p>I plan on including this: </p>
  
  <p><a href="http://jsfiddle.net/8YBu5/7/" rel="nofollow">http://jsfiddle.net/8YBu5/7/</a></p>
  
  <p>That way a user must agree to the T&amp;C's when signing up before being allowed to submit their details if on on the specified url with the billing secret is “apples”. If they are on a different url, the radio does not exist and the submit button is enabled.</p>