Trigger microflow on enter key

1
Good morning, Just a quick question to see if it is possible to trigger a microflow when a user presses the 'enter' key within a textbox? Regards, Matt
asked
2 answers
0

Add a microflow button next to the text box. You can hide it if you don't need to show it. Give it a class name (right click properties, common section). Name could be searchBtn.

Use the HTML Snippet from the app store and place it under the search box. Set the content type to Javascript.

Set the class name on the text box. Lets call it searchBox.

Here's a sample jquery that you can place in the contents section of the widget.

$(document).ready( function () { $(".searchBox").keyup(function(event){ if(event.keyCode == 13){ $(".searchBtn").click(); /Trigger the click action (search button) when user presses enter./ } }); });

This should work on I.E >= 8.0.

answered
0

Thanks for the answer Julio. I cant seem to get the button click event to fire using the below:

$(".searchBox").keypress(function(event){

var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
    $(".goweb").click();    
}

});

However if I test the key press function I can get an alert to fire on the screen with the below:

$(".searchBox").keypress(function(event){

var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
    alert('You pressed a "enter" key in textbox');  
}

});

Seems like the click() function wont fire, do you have any ideas?

Cheers,

Matt

answered