
{{<govuk_template}}

{{$head}}
  {{>includes/elements_head}}
  {{>includes/elements_scripts}}
{{/head}}

{{$propositionHeader}}
  {{>includes/propositional_navigation3}}
{{/propositionHeader}}

{{$headerClass}}with-proposition{{/headerClass}}

{{$content}}

<header class="page-header">

</header>

<main id="page-container" role="main">
  <div class="phase-banner">
    <p><strong class="phase-tag">ALPHA</strong><span>This is a new service – your <a href="#">feedback</a> will help us to improve it.</span>
    </p>
  </div>
  <form action="medical-form" method="get" class="form inline">

    <div class="grid-row" id="q1">
      <div class="column-full">

        <h4 class="heading-large">Does your cancer affect your ability to drive?</h4>

      </div>
    </div>

    <div class="grid-row" id="q1">
      <div class="column-two-thirds">
        <div class="form-group" id="question">
          <legend>
            <span class="error-message" style="display: none;">
              Please select a valid option
            </span>
          </legend>

          <label class="block-label" for="q1-a1" id="q1-a1-label">
            <input id="q1-a1" type="radio" name="q1-answer" value="Y" onclick="">Yes
          </label>
          <label class="block-label" for="q1-a2" id="q1-a2-label">
            <input id="q1-a2" type="radio" name="q1-answer" value="N" onclick="">No
          </label>
        </div>
      </div>
    </div>

    <div class="form-group">
      <input id="continue" name="continue" type="button" class="button" value="Continue" onclick="validate()">
    </div>

  </form>

  <form action="">
    <a class="back-to-previous" href="javascript:history.go(-1);">
      <i class="fa fa-angle-left"></i> Back <span class="visuallyhidden"> to the previous question</span>
    </a>
  </form>

  <script>
    function validate() {
      var value = $('input[name=q1-answer]:checked').val();

      if (value == 'Y') {
          localStorage.G = true;
          window.location.href = 'V-CONDITION';
      } else if (value == 'N') {
          window.location.href = 'V-CONDITION';
      } else {
        $('#question').addClass('error');
        $('.error-message').show();
      }
    }
  </script>

</main>

{{/content}}

{{$bodyEnd}}
{{/bodyEnd}}

{{/govuk_template}}