craigtolputt Posted February 25, 2010 Share Posted February 25, 2010 Hi Guys, I have a form with a select box which has, how many guests will be attending. The options are 1,2,3,4,5. So all i need to do is change a text value based on what option they select. So if they select: 1 - the price text value will change to £25 2 - the price text value will change to £50 3 - the price text value will change to £75 4 - the price text value will change to £100 5 - the price text value will change to £125 I also have a paypal button integrated which i bought from codecanyon but at the minute all the values are static and defined in the top of the php page. so i have this which tells paypal how much to charge but this is what i need to make dynamic. # Product Price in GBP (example 5.00 or 5.99) define('ProductPrice','25.00'); Any ideas would be greatly appreciated. thanks Craig Link to comment https://forums.phpfreaks.com/topic/193357-changing-a-text-value-based-on-a-select-box-drop-down/ Share on other sites More sharing options...
ocpaul20 Posted February 27, 2010 Share Posted February 27, 2010 PHP is a server side language and the html is generated before the page is displayed. If you want to do anything dynamically, you will have to use javascript, ccs, or jquery-type stuff. Link to comment https://forums.phpfreaks.com/topic/193357-changing-a-text-value-based-on-a-select-box-drop-down/#findComment-1018847 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.