Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying data from right to left in a textbox

 
jyoti vij
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to display data from right to left in a textbox. There should be one fixed decimal point in a textbox and the user is allowed to enter data only to the right and not in the left of decimal. As the user keeps on entering digits the data will be shifting to left of decimal. It should be similar to the scenario of entering amount to be withdrawn from an ATM.
 
Anirvan Majumdar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1 => Use the attribute "dir" with value "rtl" to get your right-to-left direction of text entry in the textbox.
2 => Write a method attached to the event: "onkeyup", which verifies that the user is entering data to the right of the decimal point and also performs the shifting of the digits as is the case in an ATM m/c. You'll need to do some text manipulation here.
 
jyoti vij
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.
But i have one more query. How can i display a decimal point at fixed position in a textbox? Also how to check whether the user has entered data to the left or right of the decimal?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic