I have such a problem:
Firebase authentication working in computer, android devices and iphone 4, 6.
But no work on iphone 5. When click enter, nothing happens.
What can be?
Thank you very much.
component.ts
onLogin(){
let data = {
email: this.user.email,
password: this.user.password
}
this.af.auth.login(data).catch(function(error){
});
}
component.html
<form #f="ngForm" (ngSubmit)="onLogin()">
<div class="form-group">
<md-input-container class="full-width">
<input mdInput name="email" type="email" required placeholder="Email" [(ngModel)]="user.email">
</md-input-container>
</div>
<div class="form-group">
<md-input-container class="full-width">
<input mdInput name="password" type="password" required placeholder="password" [(ngModel)]="user.password">
</md-input-container>
</div>
<div class="form-group">
<button md-raised-button type="submit">enter</button>
</div>
</form>
Related
Whenever I try sending an email through an email form I made, it redirects me to another page that keeps loading for several minutes. After a random amount of time (from minutes, to even days), I get the email I sent.
I'm not sure why this is happening and have not yet found a solution. This is my code for the form:
<div class="mail">
<h1 style="font-size: 50px;">Contact Us</h1>
<form target="_blank" action="https://formsubmit.co/xxxx#gmail.com" method="POST">
<div class="form-group">
<input type="hidden" name="_template" value="table">
<div class="form-row">
<div class="col">
<input type="text" name="name" class="form-control" placeholder="Full Name" required>
</div>
<div class="col">
<input type="email" name="email" class="form-control" placeholder="Email Address" required>
</div>
</div>
</div>
<div class="form-group">
<textarea placeholder="Your Message" class="form-control" name="message" rows="10" required></textarea>
</div>
<button type="submit" class="btn btn-lg btn-dark btn-block">Submit Form</button>
</form>
I'm doing a login form with laravel. What I want is to validate the POST values, and if it's OK, then redirect to dashborad. If not, redirect back with Input. This is my login form :
<form method="post" autocomplete="off">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group">
<label for="email">Adresse courriel:</label>
<input type="email" class="form-control" id="email" name="email" required>
</div>
<div class="form-group">
<label for="password">Mot de passe:</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-aqua">Se connecter</button>
</form>
And this is my AuthController function :
public function postLogin(Request $request){
Log::info('Showing user profile for user: '.$request);
if (Auth::attempt(['email' => $request->email, 'password' => $request->password])) {
return redirect()->route('/admin/dashboard');
}
return redirect()->back()->withInput(Input::all());
}
When it's redirecting back, my input are note filled.
Laravel implements a old() function which brings back input data if the form submitted has errors:
<form method="post" autocomplete="off">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group">
<label for="email">Adresse courriel:</label>
<input type="email" class="form-control" id="email" name="email" required value="{{ old('email') }}">
</div>
<div class="form-group">
<label for="password">Mot de passe:</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-aqua">Se connecter</button>
</form>
I strongly recommend to not bring back the password. I know this is annoying, but safer imo.
More info : https://laravel.com/docs/5.4/requests#old-input
I am trying to validate my data for a student object with Angular Form Validation, but when I want to use or print for example, the serialNumber of a student it gives me this error: Cannot read property 'serialNumber' of undefined.
Here is the code:
<div *ngIf="student">
<div class=container>
<h2>Student {{student.name}} details</h2>
<form name="studentForm" (ngSubmit)="save()">
<!--<div ng-class="{ 'has-error' : studentForm.serialNumber.$invalid && !studentForm.serialNumber.t">-->
<label>Serial number: {{student.serialNumber}} </label>
<input type="text" name="serialNumber" class="form-control" ng-model="student.serialNumber" required>
<div ng-messages="studentForm.serialNumber.$error">
{{studentForm.serialNumber}}
<p ng-message="required">Your name is required!</p>
</div>
<!--</div>-->
<div>
<label>Name: {{student.name}}</label>
<input ng-model="student.name" placeholder="name">
</div>
<div>
<label>Group number: {{student.groupNumber}}</label>
<input ng-model="student.groupNumber" placeholder="groupNumber">
</div>
<button (click)="goBack()">Back</button>
<button (click)="save()">Save</button>
</form>
</div>
</div>
The ng-messages and ng-model attribute directives do not exist in Angular 2+. I would recommend reading into Angular Forms, ReactiveForms, and Template Syntax.
If you would like to dual data-bind the input values, you can do so with the following syntax: [(ngModel)]="student.serialNumber". However, in Angular 2+, there are usually better ways of getting values other than explicitly data-binding.
Angular Form Validation template Driven Model
onSubmit(form : NgForm) {
console.log(form);
}
<form #form="ngForm" (ngSubmit)="onSubmit(form)"
[ngClass]="{'was-validated': form.invalid && (form.dirty || form.touched)}">
<div class="" ngModelGroup="User">
<h2 class="text-center">Registration page</h2>
<br />
<div class="form-group">
<input type="text" class="form-control" placeholder="First Name" name="firstname" required
ngModel #firstname="ngModel">
<span class="help-bpx" *ngIf="firstname.touched && !firstname.valid ">Please enter the
firstname</span>
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Last Name" name="lastname" required ngModel
#lastname="ngModel">
<span class="help-bpx" *ngIf="lastname.touched && !lastname.valid ">Please enter the
lastname</span>
</div>
<div class="form-group">
<input type="email" class="form-control" id="email" placeholder="Email" name="email" email
required ngModel #email="ngModel">
<span class="help-bpx" *ngIf="email.touched && !email.valid ">Please enter the Email
Value</span>
</div>
<div class="form-group">
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFile" required ngModel name="file" #file="ngModel">
<label class="custom-file-label" for="customFile">Choose file</label>
</div>
</div>
<br />
<div class="align-center">
<button type="submit" class="btn btn-primary" [disabled]="!form.valid">Register</button>
</div>
</div>
</form>
I have the below code where I'm trying to submit data from a form into my back-end. Whenever I press the button it doesn't do anything and it's supposed to route to the specified place. I have looked at several examples and still hasn't worked. Below is my form. Any suggestions?
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4 text-center">
<h1>Sign Up</h1>
<form action ="/adduser" method="POST" id="adduser">
<fieldset class="form-group">
<label for="InputUsername"> Username </label>
<input type="text" class="form-control" name="username" id="InputUsername" placeholder="Enter username">
</fieldset>
<fieldset class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" name="email"id="exampleInputEmail1" placeholder="Enter email">
<small class="text-muted">We'll never share your email with anyone else.</small>
</fieldset>
<fieldset class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" name="password"id="exampleInputPassword1" placeholder="Password">
</fieldset>
<button class="btn btn-default" form="signup" type="submit">Sign up</button>
</form>
</div>
</dv>
</div>
Here is my route
#app.route('/adduser', methods=["POST"])
def adduser():
print(request.form, file=sys.stderr)
username = request.form['username']
password = request.form['password']
email = request.form['email']
models.User.create_user(email, password, username)
login_user(user)
return redirect_url('index.html')
Your button has a form attribute of signup but your form has an id of adduser, so the button does not belong to the form. Try changing these values to match.
This is utterly bizarre! I have a simple username/password form:
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="LoginUserName" class="col-md-2 control-label">User name</label>
<div class="col-md-10">
<input type="text" id="LoginUserName" class="form-control" data-bind="value: userName, hasFocus: setFocus" />
</div>
</div>
<div class="form-group">
<label for="LoginPassword" class="col-md-2 control-label">Password</label>
<div class="col-md-10">
<input type="password" id="LoginPassword" class="form-control" data-bind="value: password" />
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<div class="checkbox">
<input type="checkbox" id="LoginRememberMe" data-bind="checked: rememberMe" />
<label for="LoginRememberMe">Remember me?</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<button type="submit" class="btn btn-default" data-bind="click: login, disable: session.isBusy()">Log in</button>
</div>
</div>
</form>
First time through, it all works fine and the user is logged in. After logging out and re-entering the user name, the password field is auto-filled. No matter if this is left auto-filled or retyped, when the login method is called, the password field is empty!
If I change the password to an incorrect one it triggers firefox to pop up the "password has changed, do you want to update...?" box at the top of the page. Provided that I answer "yes" to this and then, after that login fails, enter the correct one then it all works and I can log in.
Why on earth is firefox blanking out the password in this circumstance? Completely confused!