I’m looking to create a pretty simple calculator, but I need it to update on each keystroke. I cannot seem to find anything in that specific category. Can anyone point me to the right direction?
I’m looking for something like A*1.325 + B*3.76 where B is a drop down menu and A is the text field that people will be filling out. Every time the drop down is changed or a keystroke is registered in the text box.
I will also try to do some RegEx to only allow numbers or decimal points!
Thank you guys very much!!!
PS. Will be using PHP/HTML to create the form.
Step 1:
Do the jQuery tutorials. fun fun fun 😀 😀 😀
http://docs.jquery.com/Tutorials
Step 2:
Now that you understand jQuery, notice that jQuery supports a bunch of event handlers. For instance, you can assign a click event to something that resembles an item in a dropdown menu:
Step 3:
Chose the right event handlers to use.
click(for the dropdown menu) andkeyup(for the text field) sound hopeful.Step 4:
Keep tinkering. You don’t need PHP at all.