473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Dropdown changing values ( javascript & asp )

Fary4u
273 100+
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 2526
Fary4u
273 100+
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 Expert 4TB
What version is asp is this?
Jan 25 '09 #3
Fary4u
273 100+
ASP Classic but i think i'm almost done the code
Jan 25 '09 #4
kenobewan
4,871 Expert 4TB
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 Expert Mod 8TB
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 Expert 2GB
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
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...
3
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...
2
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...
1
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...
3
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,...
14
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...
6
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...
13
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...
4
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.