Home › Forums › Front End PM PRO › Enter Button Not Working When Trying to Send a Message › Reply To: Enter Button Not Working When Trying to Send a Message
April 23, 2019 at 7:19 pm
#23719
Shamim Hasan
Keymaster
Add following code in your theme’s (child theme’s if you are using) functions.php
add_action( 'fep_after_form_fields', function( $where, $errors, $fields ){
if( in_array( $where, [ 'newmessage', 'reply' ] ) ) {
?>
<script type="text/javascript">
document.addEventListener("keyup", function(event) {
// Number 13 is the "Enter" key on the keyboard
if (event.keyCode === 13) {
// Cancel the default action, if needed
event.preventDefault();
document.querySelector('.fep-form').submit();
}
});
</script>
<?php
}
}, 10, 3);