I’m not even quite sure how I can make myself clear and I do apologize… but I have been searching all over the internet for a similar JavaScript code and I’m not even quite sure how to phrase the question …
Basically, I want the user to input one thing, and I want something else to pop up.
As an example, the user would type in a number, let’s say “10” into a text field or drop-down menu and then three other numbers would pop up, such as 15.25, 16.50, and 17.75 (either in pop window form, or just in a plain sentence, or in other text fields … it doesn’t really matter).
What I’m doing is I want to post an estimate calculator for loan payments on a website (with options for 30 day, 60 day, and 90 day payoff options).
There’s no math involved in this code whatsoever (I understand if I have to input a lot of numbers – I already have those!). I don’t want to create a calculator, because I think a calculator would be more complicated (I’m aiming for simple!) … The loan fees and interest vary from one group of numbers to another, so if it were to be a calculator the script might get really complicated (because we’re not looking at a easy 1 + 1 = 2 equation … it’s more like 1 + 1.50 + 1.00 = 3.50, or 10.00 + 4.00 + 1.25 = 15.25, or even 30.00 + 6.00 + 1.75 etc., there’s no consistency).
So I’m figuring a simpler way around this beast would be to have the numbers readily available, with no calculations. So if they enter in a 1, the result they would get be 3.50, 4.50, and 5.50.
I don’t know, that might be asking a bit much too….
Thank you in advance for your time and help.
In a simplest form it will look like this:
We use hash-map (aka javascript object) each element of which is an array, and each element of those arrays is your desired number.
Then, we give user a popup with question and store his answer (or his input) into variable.
Then we use this variable as a key for our hash-map.
p.s.: there are several issues with solutions above, so its purely for educational reasons.