Calculation based on dropdown option

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

shamilwebdev
New php-forum User
New php-forum User
Posts: 2
Joined: Thu Oct 03, 2013 2:01 am

Calculation based on dropdown option

Postby shamilwebdev » Thu Oct 03, 2013 2:05 am

Hi Friend,

I am developing php page, I am struck on one part :banghead:

I have 3 dropdown menus.

1) Room Type
2) No of Person
3) Extra Person
and a Textbox

Now my Issue is, When I select Room type as Executive the amount should be shown on textbox and select "premium" relevant amount should be shown.
when I add Extra Person, Rs 500 should be added in textbox.

Thanks
shamil

RYMK0087
New php-forum User
New php-forum User
Posts: 5
Joined: Tue Oct 08, 2013 5:38 am

Re: Calculation based on dropdown option

Postby RYMK0087 » Mon Oct 21, 2013 4:39 am

Hi,

What is your question exactly? Just the calculation part? If so, you can use onchange option for the Extra Person dropdown and call a JS function that gets the value in the Text box and changes it to textbox.value+500. Is the added value dependent on what number is selected in the Extra Person dropdown?

Hope that helps.


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests