0

I'm building a calculator that has a slider. Everytime I slide the bar an input box is updated with the number, the calculator passes the value and updates the calculation.

So my input boxes have dollar values that can range anywhere from $0 to $10,000.

Right now my boxes display 0 to 10000 and I want them to be displayed as $0 to $10,000.

I'm assuming jquery would be my best route here. How do I format an input box to display values like this. Sort of like an input mask.

note: users never have to type into the input box, its all controlled by the slider.

1
  • do you have a jQuery code already?.. can we see it? Commented May 12, 2010 at 1:09

1 Answer 1

1

I think you might want to check out this plugin: http://plugins.jquery.com/node/14738

Sign up to request clarification or add additional context in comments.

4 Comments

a plugin for this easy task would be like overkill :p
That looks perfect, however it throws foreign characters into my input and then breaks the calcuator with NaN
@Wes Foreign characters were thrown to your input? Could you show us your codes?
I was doing this all wrong. I shouldn't be using an input to hold my values. I've switched everything over to having a variable hold my value and now I'm going to use the above plugin to format my output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.