I'm trying to store an entry by keyboard or input
in a variable, but when I try to print it, it returns empty.
It is a simple login.
I have a file called login.js, in which I set the from
as follows:
Template.login.events({
'submit form': function(event) {
event.preventDefault();
Meteor.loginWithPassword(**aux =** event.target.usuario.value, event.target.clave.value, function(err){
Regarding the html file, the code it presents is the following:
div class="modal-body">
<form class="form col-md-12 center-block">
<div class="form-group">
<input name="usuario" type="text" id="inputEmail" class="form-control input-lg" placeholder="Usuario" required autofocus>
</div>
<div class="form-group">
<input name="clave" type="password" id="inputPassword" class="form-control input-lg" placeholder="Contraseña" required>
</div>
<div class="form-group">
<button class="btn btn-lg btn-primary btn-block" type="submit">Ingresar</button>
<br>
<!--Es posible que sea necesario,destinar un link, para ayudar al usuario en el caso de que no pueda acceder-->
<span><a id="ayuda" href="#">¿Necesitas ayuda?</a></span>
</div>
</form>
</div>
When trying to print the value of said variable from another template
( {{aux}}
), through the html file, it does not print any value. The value I'm trying to store and print to another template
is the username,
I have tried this process by importing and exporting the variable in various ways, but I never get to print the value. Honestly, I'm not very sure how to do it (I'm new to web programming, and Meteor)
1 Answers