Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to add a menu to my website with values that add as selected

Status
Not open for further replies.

RRickard

Technical User
Jul 31, 2000
2
0
0
US
I want to have a menu for my customers to use to choose the various services I have.  I may have 20 or 30 items to choose from.  I will assign a value to each and as the item is checked or selected using a radio button, the form would add and give a total.  Can someone help me with this?  Is there a form I can just modify?  I am not a programmer, just a novice Frontpage 2000 user.
 
for basics, what you need is a table with the product names a check boxes, and the prices - it would probably be easiest to have each product have 3 seperate fields across the table.<br>then you need a form showing all these fields on your form.<br>then in the After Update property of each of the checkboxes, have a Macro that simply does a Refresh on the form.&nbsp;&nbsp;and have an unbound textbox on the form for the total that has a formula to add all the prices together for all the fields that are checked.&nbsp;&nbsp;the easiest way to do this would probably be to multiply the price*Yes/No (which is saved as -1/0, respectively) and then add all of those totals together, and then multiply by -1.<br><br>ok, this makes it sound harder than it is, but the formula for the total would look like:<br><br>= -1*([Item1Price]*[Item1Check]+[Item2Price]*[Item2Check]+[Item3Price]+[Item3Check])&nbsp;&nbsp;<br>and so on. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
If you put the items in a database of somesort then it becomes very easy to:<br>1. Create a table to show the items<br>2. check to see if they are checked or not<br>3. to add them up if they are.<br>This would be done in a Loop for Next or Do Until:<br><br>Here is one I am using to do something similar: Now this requires your ISP to have Active Server Pages (.ASP)<br>-------------------------------------------------<br>&lt;%@ Language=VBScript %&gt;<br><br>&lt;%<br> Set Conn = server.CreateObject(&quot;ADODB.Connection&quot;)<br> Conn.Open &quot;driver=SQL Server;server=server.com;uid=UserID;pwd=password;database=databasename;&quot;<br> Set RS1 = Conn.Execute(&quot;SELECT [STOCK_CODE], [Description], [SELLING_PRICE] FROM [Copy-PartMaster Lite]&quot;)<br>%&gt;<br><br><br>&nbsp;&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td width=&quot;10%&quot; align=&quot;left&quot;&gt;&nbsp;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td width=&quot;18%&quot; align=&quot;left&quot;&gt;&nbsp;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td width=&quot;52%&quot; align=&quot;left&quot;&gt;&nbsp;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;td width=&quot;12%&quot; align=&quot;right&quot;&gt;&nbsp;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br><br>&lt;%If Not RS1.EOF Then<br>&nbsp;&nbsp;&nbsp;Do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td width=&quot;10%&quot; align=&quot;left&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p align=&quot;center&quot;&gt;&lt;input type=&quot;submit&quot; value='Add &lt;%=RS1(&quot;STOCK_CODE&quot;)%&gt;' name=&quot;addtopo&quot;&gt;&lt;/td&gt;<br>&lt;td width=&quot;18%&quot; align=&quot;left&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p align=&quot;center&quot;&gt;&lt;%Response.Write RS1(&quot;STOCK_CODE&quot;)%&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td width=&quot;52%&quot; align=&quot;left&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p align=&quot;center&quot;&gt;&lt;%Response.Write RS1(&quot;Description&quot;) %&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td width=&quot;12%&quot; align=&quot;right&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p align=&quot;center&quot;&gt;&lt;%Response.Write RS1(&quot;SELLING_PRICE&quot;)&gt;&lt;/td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RS1.Movenext<br>&nbsp;&nbsp;&nbsp;Loop Until RS1.EOF<br>End If%&gt;<br>----------------------------------------<br><br>this puts a Command button in the first row of the table.<br><br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Thank you Doug.&nbsp;&nbsp;I guess I need to get familiar with ASP and I will contact my ISP and see if ASP is supported.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top