hargz09 Posted August 25, 2009 Share Posted August 25, 2009 Hi, I need to create a form but I'm unsure what to create it with. It needs to firstly display values for each item: For example Red + £3, Blue -£2 It will then need to show a total at the bottom. It then also needs to only show only items that value to the Model Chosen. For Example if Model A is selected: Blue Green and Red display If Model B is selected Blue, Yellow and purple display in the colour choice. It then needs to be saved into a database and the values need to be easily changed. Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/171827-calculating-form/ Share on other sites More sharing options...
Mardoxx Posted August 25, 2009 Share Posted August 25, 2009 ask in HTML help for the form then for the "calculation" bit, ask in Java Script. Quote Link to comment https://forums.phpfreaks.com/topic/171827-calculating-form/#findComment-906030 Share on other sites More sharing options...
ignace Posted August 25, 2009 Share Posted August 25, 2009 CREATE TABLE models ( models_id INTEGER NOT NULL AUTO_INCREMENT ); CREATE TABLE colours ( colours_id SMALLINT NOT NULL AUTO_INCREMENT ); CREATE TABLE models_colours ( models_colours_models_id INTEGER NOT NULL, models_colours_colours_id SMALLINT NOT NULL, PRIMARY KEY (models_colours_models_id, models_colours_colours_id) ); INSERT INTO models_colours VALUES (1, 1), # model A has color red (1, 2), # model A has color green (1, 3), # model A has color blue (2, 3), # model B has color blue (2, 4), # model B has color yellow (2, 5); # model B has color purple SELECT * FROM colours JOIN models_colours ON colours_id = models_colours_colours_id WHERE models_colours_models_id = 1 # returns red, green and blue Quote Link to comment https://forums.phpfreaks.com/topic/171827-calculating-form/#findComment-906097 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.