like you suggest me in one of my previous posts to set a "default" button on a form I should use the following code in the form Javascript :
- Code: Select all
$(document).ready(function () {
$("input").on("keydown", function (event) {
var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode));
if (keycode == 13) {
$(<#FindCustomerButton#>).click();
return false;
} else {
return true;
}
});
});
and in the OnCreate event of the form :
- Code: Select all
JavaScript.Text := StringReplace(JavaScript.Text, '$(<#FindCustomerButton#>)','document.getElementById('''FindCustomerButton.JQHTMLName + ''')', [rfReplaceAll, rfIgnoreCase]);
It has worked fine in forms but now I need to set a default button in a ajax dynamically created frame.
How can I achieve the same behaviour as in the form?
Thank you and happy new year!
Davide