TextBoxEnterKey Widget

0
I have a button (search button), separate to the TextBoxEnterKey widget (search box), that runs the same microflow (search) as the widget. That way, it acts as though the ENTER key was pressed inside the widget. However, when the button is used after typing into the textbox widget, all but the last character of the textbox input is delivered to the associated attribute field (search string). All of the input is available when the ENTER key is pressed. Eg. Search box contents                       Search string (button)                           Search string (ENTER key)       ABC                                                     AB                                                            ABC Is there anything that can be done about this?
asked
1 answers
3

Hi Andrew,

If its an issue with the widget you can try using a normal text box widget and jquery to click the search button when the enter key is pressed. You need to use the html/javascript snippet widget and add this script in it (make sure jquery is enabled). 

$(".text-box-class input").keyup(function(event) {
    if (event.keyCode === 13) {
        $(".btn-search").click();
  
    }
});

 

replace text-box-class with a class from your text box and replace btn-search with a class from your search button. 

 

 

Here is a link to the html/javascript snippet 

https://appstore.home.mendix.com/link/app/56/Mendix/HTML/-JavaScript-Snippet

 

Hope this helps!

answered