Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

question about textbox  RSS feed

zheng yu
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a text box in browser . Its Html code is like :
<INPUT type="text" name="textfield" size="80" MaxLength="40">
because the only input device is touch panel , so i create some keypads( Like japanese , english , chinese etc. )to simulate keyboard input .Javascript code is like
function keypress(txt) {
document.form1.textfield.value += txt ;
i have 2 question :
1 when i use keyboard , the text in that text field is autoscroll( you always can see what you input ) . But when i use my keypad , when text length exceed text box length , it doesnt scroll( without those arrow key or home/end ,you can not see the end of text ) . why and how can i make it autoscroll
2 Because i have set this text box's max length . when i use my keypad , it seems this max length does not take effect . Should i add some length control logic in my javascript function ?
Thanks in advance
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!