Current time: 12-07-2019, 04:00 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Send return key event using script
07-20-2016, 05:22 AM
Post: #1
Send return key event using script
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.
Find all posts by this user
Quote this message in a reply
07-21-2016, 09:15 AM
Post: #2
RE: Send return key event using script
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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 2 Guest(s)