473,782 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dropdown changing values ( javascript & asp )

Fary4u
273 Contributor
Hi i'm in deadend i don't know how to do the job i'm bit confused ?
i'm just thinking how to write the code ?

i've got dropdown list of colors & whn i select the colors it's stored into database color Varibale is ComboName

now the only problm is product price is fix ie ( 20$ ) & it's only 3 category ie ( intcat ).

but the 1st 3 colors ie ( 1,2,3 ) is 5$ less then product price
and next 4 colors ie ( 4,5,6,7 ( is 7$ less then product price

my product price variable intprice & here is dropdown coding
Expand|Select|Wrap|Line Numbers
  1.     <select id="cboColours" name="drpcolor" onChange="show()">
  2.     <option selected value="1">Make Selection</option>
  3.     <%=PopulateCombo(rsColours,"comboName","comboName")%>
  4.     </select>
  5.     <script>
  6.     function show()
  7.      {
  8. document.form1.drpcolor.options[document.form1.drpcolor.selectedIndex].value
  9.      }  
  10.     </script>
  11.     <%
  12.       if intcat = "3" then
  13.           if comboName <> 4 then
  14.               intprice = intprice - 5
  15.           elseif comboName <> 8 then
  16.               intprice = intprice - 7      else
  17.           endif
  18.       else
  19.               intprice = intprice
  20.       endif
  21.     %>
  22.  
any help thx in advance
Fary
Jan 23 '09 #1
6 2544
Fary4u
273 Contributor
Hi Jhardman i need it to sort urgent any solution plz let me know
coz u always help me on hard time
Thx
Fary
Jan 23 '09 #2
kenobewan
4,871 Recognized Expert Specialist
What version is asp is this?
Jan 25 '09 #3
Fary4u
273 Contributor
ASP Classic but i think i'm almost done the code
Jan 25 '09 #4
kenobewan
4,871 Recognized Expert Specialist
Thought so. I assume you are aware that there is an ASP classic forum, asp is not asp.net. Well done on figuring out the code :).
Jan 26 '09 #5
acoder
16,027 Recognized Expert Moderator MVP
Do you want this to be coded at the client or at the server-side?

You can't mix client-side and server-side code. Once the page has loaded, the server-side no longer runs.
Jan 26 '09 #6
jhardman
3,406 Recognized Expert Specialist
Hey Fary,

Not sure I understand the problem. The part of the code that subtracts the price is definitely wrong, code should be:
Expand|Select|Wrap|Line Numbers
  1.     <%
  2.        if intcat = "3" then
  3.            if comboName < 4 then
  4.                intprice = intprice - 5
  5.            elseif comboName < 8 then
  6.                intprice = intprice - 7
  7.            endif
  8.        endif
  9.      %>
But was that the only problem? I'm not sure. Please explain again if that doesn't solve everything.

Jared
Jan 26 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
10164
by: Rod Early | last post by:
I need to know when the select element's dropdown list is opened (as when the user clicks on the arrow or does ALT-downarrow from the keyboard). Similarly, I need to known when the dropdown list closes. The closing of the dropdown list can happen without changing the dropdown, hence the onchange event is not a sure way to determine that the dropdown list closed. Is this possible in Internet Explorer?
3
10760
by: Robert Mark Bram | last post by:
Hi All! Has anyone seen an example of the following javascript powered control: - a dropdown select menu - the width of the control is set. Assume by "control" I mean the visible part of the drop down before a mouse click occurs. - the width of the list when selected is dynamic - the width of the list can grow beyond the width of the control without changing the width of the control.
2
3630
by: Chris Becker | last post by:
This is my attempt to rephrase a question I asked earlier that got no response. I suspect it was my poor/unplanned wording. Here is another attempt: I have a form with some drop down lists. I would like the user to be able to start filling in the form, then get to one of the dropdown lists (ex: Service Type) and realize that the dropdown list does not contain the entry that they need. So next to the Service Type drop down list is a...
1
1025
by: Jim Corey | last post by:
I have an ASP app that I've recreated in ASP.NET and have a problem recreating one part of it. The original includes a dropdown (an html select object with name='Origin') that I populate using javascript when I change a second dropdown. Each time I change the selection in the second dropdown, it repopulates the other. When the form posts, I'm in another page and I can get the value using: Request("Origin")
3
1578
by: Jon | last post by:
I am using cascading dropdowns, where the selection in one determines what fills another. In regular ASP I simply loaded a giant dataset into javascript array and when you clicked on one dropdown, it populated the others accordingly. In ASP.Net, I was looking for a way to do this without javascript. So, I made my form and put code in the SelectedIndexChanged event of the dropdown that populates the next dropdown. Of course to do this,...
14
5935
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only because of this, so I hope some of you gurus can enlighten me with this :) In what circumstances can the "&amp;" in the source code be involuntary changed to "&" by a browser when or other software, when editing and uploading the file to the web...
6
3851
by: Melissa | last post by:
Initially the form is loaded using ASP and HTML and the ü codes display the characters correctly. I have the values stored in a javascript array so that I can more easily and dynamically change the state/region dropdown when the country changes. However, when my javascript code tries to add the new option and print out new region the literal value such as "Würrtemberg" is displayed instead of the special character. Can this be done in...
13
2198
by: Shutey | last post by:
I have a strange issue with dropdowns. Using php4, mySQL5, Apache 2 on a fast XP pro PC, I have a form which requires 5 dropdowns populated with indentical values. I extract the values using SQL and populate 2 variables and use a for-next loop to create the dropdown. The dropdown contains some 310 items! It works beautifully if I have 1 or 2 dropdowns but as soon as I add more it partially creates the 3rd and just stops until it times out!...
4
4587
by: zion4ever | last post by:
Hello good people, Please bear with me as this is my first post and I am relative new to ASP. I do have VB6 experience. I have a form which enables users within our company to do an intranet reservation of available resources (laptops, beamers, etc). The MySql database queries are already in place, as is the ASP administration panel. The frontend that users will see however, still needs some work. I'm really close, but since I'm no...
0
9479
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10146
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8967
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6733
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4043
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2874
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.