Orignial message at: https://sourceforge.net/forum/message.php?msg_id=4869053 By: ya-yah I had problem when I pressed Backspace on Disable Textbox in zul page then Browser return to previous web page and other lately data was input by user to lose. By the way,I found the javascript that can help for html page like this.... <script type="text/javascript"> document.onkeydown = function() { var t=event.srcElement.type; var kc=event.keyCode; return ((kc != 8 && kc != 13) || ( t == 'text' && kc != 13 ) || (t == 'textarea') || ( t == 'submit' && kc == 13)) } </script> I try to use javascript in onCreate method of Window Class like this.... public void onCreate(){ Clients.evalJavaScript("" + " document.onkeydown = function() "+ " {var t=event.srcElement.type;"+ " var kc=event.keyCode;"+ " return ((kc != 8 && kc != 13) || ( t == 'text' && kc != 13 ) ||"+ " (t == 'textarea') || ( t == 'submit' && kc == 13))"+ " }"+ } I'm unsurely about that, correct or incorrect? It unapplicable in zul page .It still return to previous web page. I wanna get some suggestion, please give me more knowledge... thank you so much for your suggest.
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4869053
By: ya-yah
I had problem
when I pressed Backspace on Disable Textbox in zul page
then Browser return to previous web page and other lately data was input by user to lose.
By the way,I found the javascript that can help for html page like this....
<script type="text/javascript">
document.onkeydown = function()
{
var t=event.srcElement.type;
var kc=event.keyCode;
return ((kc != 8 && kc != 13) || ( t == 'text' && kc != 13 ) ||
(t == 'textarea') || ( t == 'submit' && kc == 13))
}
</script>
I try to use javascript in onCreate method of Window Class like this....
public void onCreate(){
Clients.evalJavaScript("" +
" document.onkeydown = function() "+
" {var t=event.srcElement.type;"+
" var kc=event.keyCode;"+
" return ((kc != 8 && kc != 13) || ( t == 'text' && kc != 13 ) ||"+
" (t == 'textarea') || ( t == 'submit' && kc == 13))"+
" }"+
}
I'm unsurely about that, correct or incorrect?
It unapplicable in zul page .It still return to previous web page.
I wanna get some suggestion, please give me more knowledge...
thank you so much for your suggest.