This topic is locked

By pressing ENTER fire event button Click

7/21/2020 2:43:38 AM
PHPRunner Tips and Tricks
Myr0n author

I use this code in the Registration user form, assuming the last field in the form is password.When the user press ENTER in the field password the below code will click on the button register_save.
I modified to my needs from this post.



copy and paste the code below in JavaScript OnPageLoad from Register Page.

var ctrlPassword = Runner.getControl(pageid,'password');
ctrlPassword.on('keypress', function(e) {

if(e.which == 13) {

pageObj.getItemButton('register_save').click();

}

});



p.d.If someone find out how to implement this code in an event field, please share it.

Thank you