I am trying to change the action of an html form dependent on which radio button is checked. I am trying to use jquery to do this. I have some code and can' work out why it is not working. Can someone please help me get this code working.
html:
<form name=loginForm id='login' action='' method='post'>
<legend>Login</legend>
<input type='text' name='email' maxlength="100" placeholder="Email"/>
<input type='password' name='password' maxlength="100" placeholder="password"/>
<div class="checkBoxGroup">
<label for="Employer">Employer</label>
<input type="radio" name="status" id='employer' value="employer">
</div>
<div class="checkBoxGroup">
<label for="Staff">Staff</label>
<input type="radio" name="status" id='staff' value="staff">
</div>
<input type='submit' name='Submit' value='Login' />
</form>
Javascript:
$(document).ready(function(){
$("input[name='status']").change(function(){
if($("#employer").prop("checked", true)){
$("#login").attr("action", "DB/employerVerification.php")
}
else{
$("#login").attr("action", "DB/userVerfification.php")
}
}