Form - Calculate Prices

Form that adds up prices in check boxes

Page 1 of 1

9 Replies - 5183 Views - Last Post: 24 September 2009 - 07:53 AM Rate Topic: -----

#1 bmcc81   User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 320
  • Joined: 10-July 07

Form - Calculate Prices

Post icon  Posted 21 September 2009 - 10:38 AM

Hi,

Can anyone tell me how to calculate prices in a form from a check box?
Are there any really good tutorials out there that anyone may know of?

Thanks,
Bmcc
Is This A Good Question/Topic? 0
  • +

Replies To: Form - Calculate Prices

#2 Wimpy   User is offline

  • R.I.P. ( Really Intelligent Person, right? )
  • member icon

Reputation: 159
  • View blog
  • Posts: 1,038
  • Joined: 02-May 09

Re: Form - Calculate Prices

Posted 21 September 2009 - 10:44 AM

Try W3Schools tutorials on PHP and Javascript or browse through the ones here at DIC! :) Something will most likely pop up!

View Postbmcc81, on 21 Sep, 2009 - 07:38 PM, said:

Hi,

Can anyone tell me how to calculate prices in a form from a check box?
Are there any really good tutorials out there that anyone may know of?

Thanks,
Bmcc

Was This Post Helpful? 0
  • +
  • -

#3 bmcc81   User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 320
  • Joined: 10-July 07

Re: Form - Calculate Prices

Posted 21 September 2009 - 11:57 AM

Do you know of any specific places, cause I looked in this forum and W3Schools, but couldn't find a relevant page?

Do you know of any other places?

Thanks,
bmcc
Was This Post Helpful? 0
  • +
  • -

#4 ApacheSoft   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 20-September 09

Re: Form - Calculate Prices

Posted 21 September 2009 - 12:38 PM

You've been given places to look, where you will find your answer. I doubt you have been there, and looked. So why not try that instead of asking your question again :)

You will be surprised!
Was This Post Helpful? 0
  • +
  • -

#5 bmcc81   User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 320
  • Joined: 10-July 07

Re: Form - Calculate Prices

Posted 23 September 2009 - 10:33 AM

View PostApacheSoft, on 21 Sep, 2009 - 02:38 PM, said:

You've been given places to look, where you will find your answer. I doubt you have been there, and looked. So why not try that instead of asking your question again :)

You will be surprised!



Hi ApacheSoft,

I'm not trying to abuse the system here. I have already looked other places, and the obvious as well. This isn't the first place I come to look for answers? usually I get some good answers to my questions.


If anyone knows of a place it would be appreciated, I still haven't found what I'm looking for.

Thanks,
bmcc

This post has been edited by bmcc81: 23 September 2009 - 10:35 AM

Was This Post Helpful? 0
  • +
  • -

#6 Wimpy   User is offline

  • R.I.P. ( Really Intelligent Person, right? )
  • member icon

Reputation: 159
  • View blog
  • Posts: 1,038
  • Joined: 02-May 09

Re: Form - Calculate Prices

Posted 23 September 2009 - 11:55 AM

Then perhaps you should be a little more specific, what part of "calculating prices" is it you need information on? What is your exact problem? What do you want to get help with? :)


View Postbmcc81, on 23 Sep, 2009 - 07:33 PM, said:

View PostApacheSoft, on 21 Sep, 2009 - 02:38 PM, said:

You've been given places to look, where you will find your answer. I doubt you have been there, and looked. So why not try that instead of asking your question again :)

You will be surprised!



Hi ApacheSoft,

I'm not trying to abuse the system here. I have already looked other places, and the obvious as well. This isn't the first place I come to look for answers? usually I get some good answers to my questions.


If anyone knows of a place it would be appreciated, I still haven't found what I'm looking for.

Thanks,
bmcc

Was This Post Helpful? 0
  • +
  • -

#7 bmcc81   User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 320
  • Joined: 10-July 07

Re: Form - Calculate Prices

Posted 23 September 2009 - 12:12 PM

Hi & Thanks,

Basically, I have radio buttons that have prices attached to them. What I need to do is if the radio button is clicked on then it adds the amount to a form that gets sent out to an email address.

I've attached an example of what I need.

If someone could show me how, I have looked on the net but am unable to find an example of what I need. This would be greatly appreciated.

Thanks a bunch,
bmcc

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#8 Wimpy   User is offline

  • R.I.P. ( Really Intelligent Person, right? )
  • member icon

Reputation: 159
  • View blog
  • Posts: 1,038
  • Joined: 02-May 09

Re: Form - Calculate Prices

Posted 23 September 2009 - 12:41 PM

You would have to have the same name on the radio-buttons, and no ID, then set the value to something that identifies the different options like "LUNCH AU TRAVAIL" or something else. On the server-side you would get hold of the chosen option through $_POST['name_on_the_radio_buttons']. Then you would have to get the price from some database or wherever you get it and send it through mail using the php mail()-function which though requires a mail-server being installed and accessible from your php installation! :)
Was This Post Helpful? 0
  • +
  • -

#9 bmcc81   User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 320
  • Joined: 10-July 07

Re: Form - Calculate Prices

Posted 24 September 2009 - 06:31 AM

View PostWimpy, on 23 Sep, 2009 - 02:41 PM, said:

You would have to have the same name on the radio-buttons, and no ID, then set the value to something that identifies the different options like "LUNCH AU TRAVAIL" or something else. On the server-side you would get hold of the chosen option through $_POST['name_on_the_radio_buttons']. Then you would have to get the price from some database or wherever you get it and send it through mail using the php mail()-function which though requires a mail-server being installed and accessible from your php installation! :)



Thanks,

But what do yo mean by

Quote

On the server-side you would get hold of the chosen option through $_POST['name_on_the_radio_buttons'].


Thanks,
bmcc
Was This Post Helpful? 0
  • +
  • -

#10 RPGonzo   User is offline

  • // Note to self: hmphh .... I forgot
  • member icon

Reputation: 151
  • View blog
  • Posts: 954
  • Joined: 16-March 09

Re: Form - Calculate Prices

Posted 24 September 2009 - 07:53 AM

if your not familiar with check boxes here is a quick example ...

<?php
	if (isset($_POST['submit'])) {
		echo "<font color='red'>You have choosen the number : <font color='blue'>";
		echo isset($_POST['radio_button']) ? $_POST['radio_button'] : "no number choosen";
		echo "</font></font><br/><br/>";
	}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
	<label>Choose a Number:</label><br/>
		<input type="radio" value="one" name="radio_button"/>One<br/>
		<input type="radio" value="two" name="radio_button"/>Two<br/>
		<input type="radio" value="three" name="radio_button"/>Three<br/>
		<input type="radio" value="for" name="radio_button"/>Four<br/>
		<input type="radio" value="five" name="radio_button"/>Five<br/>
	<input type="submit" name="submit" value="Submit Choice"/>
</form>



pretty self explanatory just run it and see how it works ...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1