Tengo una situación bastante particular con un código, este es un formulario básico de registro y login, ambos usan un captcha, pero ambos no pueden funcionar juntos, cuando selecciono login retorna un respuesta en g-recaptcha-response
pero el registro no, pero cuando elimino el de login funciona perfectamente
<div class="container">
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-login">
<div class="panel-heading">
<div class="row">
<div class="col-xs-6">
<a href="#" class="active" id="login-form-link">Login</a>
</div>
<div class="col-xs-6">
<a href="#" id="register-form-link">Register</a>
</div>
</div>
<hr>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-12">
<form id="login-form" action="" method="post" role="form" style="display: block;">
<div class="form-group">
<input type="text" name="username" id="usernamel" tabindex="1" class="form-control" placeholder="Username" value="">
</div>
<div class="form-group">
<input type="password" name="password" id="passwordl" tabindex="2" class="form-control" placeholder="Password">
</div>
<div class="form-group text-center">
<input type="checkbox" tabindex="3" class="" name="remember" id="remember">
<label for="remember"> Remember Me</label>
</div>
<div class="form-group">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<!--<div id="RecaptchaField1"></div>-->
<div style="margin-bottom: 15px;" class="g-recaptcha" data-sitekey="6LfxAlAUAAAAAFhdx9DyxUqTxAcQoByXhBuGR8t7"></div>
<input type="submit" name="login-submit" id="login-submit" tabindex="4" class="form-control btn btn-login" value="Log In">
<div id="alert"><span id="mensaje"></span></div>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-lg-12">
<div class="text-center">
</div>
</div>
</div>
</div>
</form> <!--Fin de Login-->
<form id="register-form" action="index.php" method="post" role="form" style="display: none;">
<div class="form-group">
<input type="text" name="usernameR" id="usernameR" tabindex="1" class="form-control" placeholder="Username" required>
</div>
<div class="form-group">
<input type="password" name="passwordR" id="passwordR" tabindex="2" class="form-control" placeholder="Password" required>
</div>
<div class="form-group">
<input type="password" name="confirm-passwordR" id="confirm-passwordR" tabindex="2" class="form-control" placeholder="Confirm Password" required>
</div>
<div class="form-group">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<div style="margin-bottom: 15px;" class="g-recaptcha" id="capt" data-sitekey="6LfxAlAUAAAAAFhdx9DyxUqTxAcQoByXhBuGR8t7"></div>
<!--<div id="RecaptchaField2"></div>-->
<input type="submit" name="register-submit" id="register-submit" tabindex="4" class="form-control btn btn-register" value="Register Now" >
<div id="alert2"><!--span id="mensaje2"></span>--></div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
El codigo js
$('#login-submit').click(function(e){
e.preventDefault();
var captcha = $('#g-recaptcha-response').val();
alert(captcha);
}
$('#register-submit').click(function(e)){
e.preventDefault();
var captcha = $('#g-recaptcha-response').val();
alert(captcha);
}