title: In same page, how to get value from radio button and use it for the coming radio button
body: <p>In same page, how to get value from radio button and use it for the coming radio button.</p>
  
  <p>Example:</p>
  
  <p>OCountry  OGender </p>
  
  <p>If i selected Country, then the below radio button option will show:</p>
  
  <p>OAmerica
  OEngland
  OAustralia
  OMalaysia</p>
  
  <p>But all of this is before submit button. Is all in one page.</p>
  
  <p>So below is my code. Can anyone give me some advise?</p>
  
  <p>1.Blade.</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
      function show1(){
        document.getElementById('div1').style.display ='none';
      }
      function show2(){
        document.getElementById('div1').style.display = 'block';
      }
      &lt;/script&gt;
  {!! Form::open(['action'=&gt;'PostsController@store','method'=&gt;'POST']) !!}
              &lt;h2&gt;Hi,{{Auth::user()-&gt;name}}&lt;/h2&gt;&lt;br&gt;
              &lt;div class="form-group"&gt;
                  {{Form::label('roomkey','Key Number:')}}&lt;br&gt;
                      @foreach($rkeys as $rkey)
                      @if($rkey-&gt;status == "1")
                      &lt;div class="form-check form-check-inline"&gt;
                          &lt;input onclick="show1()" class="form-check-input" type="radio" name="roomkey" hidden selected&gt;&lt;br&gt;
                              &lt;input 
                              onclick="show2()" 
                              class="form-check-input" 
                              type="radio" 
                              name="roomkey" 
                              value="{{$rkey-&gt;roomkey}}" 
                              disabled&gt; 
                              {{$rkey-&gt;roomkey}}&lt;br&gt;&lt;/div&gt;
                      @else
                      &lt;div class="form-check form-check-inline"&gt;
                          &lt;input onclick="show1()" class="form-check-input" type="radio" name="roomkey" hidden selected&gt;&lt;br&gt;
                      &lt;input onclick="show2()" class="form-check-input"  type="radio" name="roomkey" value="{{$rkey-&gt;roomkey}}" &gt; {{$rkey-&gt;roomkey}}&lt;br&gt;&lt;/div&gt;
                      @endif
                      @endforeach
              &lt;/div&gt;
  //so this is the after the 1st part of radio button form.
                  &lt;div id="div1" class="hide"&gt;
                  &lt;hr&gt;&lt;p&gt;Room Number:&lt;/p&gt;
                  @foreach ($room as $room)
                  @foreach($rkeys as $rkey)
                  @if($rkey-&gt;roomkey == $room-&gt;roomkey)
                  &lt;input type="checkbox" value="{{$room-&gt;roomNum}}" name="roomNum"&gt;
                  {{$room-&gt;roomNum}} &amp;nbsp;
                  @endif
                  @endforeach
                  @endforeach
                  &lt;/div&gt;
              &lt;br&gt;
              &lt;input name="status" type="hidden" value="1"&gt;
              {{Form::submit('Submit',['class'=&gt;'btn btn-primary'])}}
          {!! Form::close() !!}
  </code></pre>