MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
WebPagetest Forums - Send return key event using script

WebPagetest Forums

Full Version: Send return key event using script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have the following HTML form that I am trying to post to.

<div class="list-group">
<input name="username" type="text" placeholder="Username" class="form-control ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required" ng-model="login.credentials.username" required="">
<input name="password" type="password" placeholder="Password" class="form-control ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required" ng-model="login.credentials.password" autocomplete="off" required="">
</div>

<button class="btn btn-lg btn-primary btn-block" type="submit" ng-disabled="form.$invalid || form.$pristine" disabled="disabled">Sign In</button>

Basically the form above takes an two input fields and than has a submit buttom.

The problem is that the submit button is initially greyed out until input is entered in both inputs. The onlyway I can get
the submit button to be ungreyed is doing a keypress in each input.


Is there a way to simulate keypress for the attributes username, and password.
So I did some research in javascript on my own and I did find a way to update my usecase.

The site that I work with includes jquery so I found this worked for me.

$('input').change();

as an exec statement.
Reference URL's