Forum Moderators: coopster

Message Too Old, No Replies

PHP and Forms

         

Aleister

9:48 pm on Nov 12, 2004 (gmt 0)

10+ Year Member



I know the basics of using php to read and process html forms, but there is one thing I cannot seem to find out.

How can I get the script to run a section of code everytime the value of a drop-down (select) box changes? Is Javascript the only way?

This will solve the problem I was having in my last post (a computer customizer type script), where the user selects from drop-down boxes, and the total value is adjusted.

StupidScript

10:22 pm on Nov 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes.

PHP only has access to the page data when it arrives at and is compiled at the server. As long as the page is sitting in the client's browser, you'll need to use Javascript or some other client-side language to effect changes.

In other words, if you're sending the page back to the server, PHP can get it and deal with it. If it's not being sent back to the server, PHP is taking a nap, and the client-side scripts are doing the work to the page in the browser.