javascript - On click of next button, based on radio button choice, how to redirect steps? -
in step step wizard in bootstrap, want able change step goes to. code i'm using https://bootsnipp.com/snippets/e3mbm . except on first step have radio button :
<div class="form-group"> <label for="assessmenttype" class="control-label">choose type</label> <div class="row col-sm-12"> <label class="radio-inline"> <input type="radio" id="female" value="female" name="radio">female </label> <label class="radio-inline"> <input type="radio" id="male" value="male" name="radio">male </label> </div> </div>
how make when male chosen redirects step-3 , when female chosen redirects step 2 ?
var val = $('input:radio[name=path]:checked').val(); switch (val) { case 'female': //show step 2 ? break; case 'male': //show step 3? break; default: }
thank you
use tolowercase()
function matching case sensitive string , hide steps before showing matched step
js code
var val = $('input:radio[name=path]:checked').val(); val = val.tolowercase(); //change case small matcing switch (val) { case 'female': //hide steps //then show step2 break; case 'male': //hide steps //then show step3 break; default: }
Comments
Post a Comment