Page 1 of 1

Calculation based on Values Selected

Posted: Thu Oct 03, 2013 4:48 am
by shamilwebdev
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

Re: Calculation based on Values Selected

Posted: Thu Oct 03, 2013 6:36 am
by Celauran
What have you written so far? What isn't working? What errors are you encountering?

Re: Calculation based on Values Selected

Posted: Thu Oct 03, 2013 7:23 am
by shamilwebdev
I have not writtern anything till now. I dont no how to write it

Re: Calculation based on Values Selected

Posted: Thu Oct 03, 2013 4:54 pm
by Christopher
You need to use Javascript for this. Write event handlers for when the dropdown menus change. I would recommend a Javascript library like jQuery.

Re: Calculation based on Values Selected

Posted: Thu Oct 03, 2013 11:14 pm
by shamilwebdev
Thanks, Can you give me any sample Link or Code for this, Hw to do it in Javascript

Re: Calculation based on Values Selected

Posted: Sat Oct 05, 2013 2:56 pm
by Christopher
Search for an example of a jQuery onChange handler for form elements. You should find lots of examples.

Re: Calculation based on Values Selected

Posted: Sun Oct 06, 2013 11:47 pm
by shamilwebdev
Thank You.

Got the solution. Now I want to Post the TextBox "Amount" to another Textbox in the same page.
I used the post method but getting an error.

estSSLtest.php on line 434 Call Stack #TimeMemoryFunctionLocation 10.0006425440{main}( )..\testSSLtest.php:0 "/>