jeudi 2 mars 2017

HTML form - need user to be able to choose an option from a dropdown list and then also enter a number into another field?

I'm for some HTML code for the following:

A form where a user chooses an option from a menu and also enters a number into another field. Then, depending on their chosen option, I need to perform a calculation that shows up on the screen. For example:

This is what the form would look like...

What type of person are you? -Dropdown list gives options(A, B, C) How old are you? -User enter a number in this field (user_age) Calculate button

When calculate button is clicked: If user chose option A, show "user_age" divided by 20. If user chose option B, show "aser_age" divided by 10. If user chose option C, show "user_age" divided by 5.

So, a user would chose option A, enter "80" into the age field, and when they click "calculate", the number "4" would appear on the screen. Can anyone help me with this? It seems straight forward.




Aucun commentaire:

Enregistrer un commentaire