• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying data from right to left in a textbox

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic