473,326 Members | 2,173 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,326 software developers and data experts.

Image selection based on multiple conditions

I have a web page that displays a weather-related image. I have 4 drop-down menus. 1) Time from 6:00 am to 6:00 pm every hour 2) a day selection (today, tomorrow, day after tomorrow) 3) image type (wind field at surface, wind field at 5000 ft, surface air temperature, cloudiness, etc). 4)location (Honolulu, La Serena, Chicago, LA, etc.) There is always one valid selection active in each drop down menu.

As individual selections are made, I'd like the appropriate image displaced.

Can't figure out how to do it ...


Derrick
Oct 3 '10 #1
1 1243
RamananKalirajan
608 512MB
You can do it easily boss. Add onchange event in the select boxes. Based upon the selection on each select display the image.

Sample:

HTML Code:
Expand|Select|Wrap|Line Numbers
  1. <select id="time" name="time" onchange="showImage()">
  2.  ...
  3. </select>
  4.  
  5. <select id="day" name="day" onchange="showImage()">
  6.  ...
  7. </select> 
  8.  
  9. <select id="imgType" name="impType" onchange="showImage()">
  10.  ...
  11. </select>
  12.  
  13. <select id="location" name="location" onchange="showImage()">
  14.  ...
  15. </select>
JS Code:

Expand|Select|Wrap|Line Numbers
  1. function showImage(){
  2.   var time = document.getElementById('time').options[document.getElementById('time').selectedIndex].value;
  3. var day = document.getElementById('day').options[document.getElementById('day').selectedIndex].value;
  4. var imgType = document.getElementById('imgType').options[document.getElementById('imgType').selectedIndex].value;
  5. var location = document.getElementById('location').options[document.getElementById('location').selectedIndex].value;
  6. //Then perform your conditions
  7. }
Thanks and Regards
Ramanan Kalirajan
Oct 4 '10 #2

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

Similar topics

1
by: M Wells | last post by:
Hi All, Just wondering if anyone can tell me if you can test for multiple conditions as part of an "IF" statement in T-SQL in SQL Server 2000? ie something like: IF @merr = 1 or @merr=2...
1
by: Anne | last post by:
I have a report containing multiple subreports (approximately 37 subreports) that are based on individual queries. The query calls to only display the subreport if there is valid data in the table...
0
by: vaskardutta | last post by:
Kindly Send Me The Detailed Code For: redirecting Users On The Click Of The Submit Button Based On The Selections From Multiple List Boxes In Asp Forms. Please Send Me The Details(code...
2
by: dasanchez | last post by:
Hello, everyone. Please bear in mind that I have a very basic knowledge of VBA, but I think I can understand logic. I'm looking for a way to build a module that can help me parse the data in one...
1
by: Richard | last post by:
Very typical normal data Table One ------ One.OneID (PK) One.Name One.Description One.TwoID (FK) One.ThreeID (FK) ....
5
by: jorgedelgadolopez | last post by:
Hi all, I am using the xpathnavigator evaluate function on .net (xpath 1 right?). Now I need to expand the code to do multiple contains, compare dates (such as 'before', 'between' and 'after'),...
3
by: kavithapotnuru | last post by:
Hi All, Can anyone help me how to give multiple conditions in a while loop in perl. For example i have a while loop for which the value of a variable is A or B it should not enter in to the...
4
by: mgleason | last post by:
Hi... Fairly new to PHP and trying to work with some images... I have a page where I need to display a different header image on based on a business type that is coming from MySQL... There are...
2
by: njsimha | last post by:
Hi, I have a query regarding the selection of a particular tag based on a condition. In the following XML code: <root> <template1> <elem1>1000</elem1> <elem2>
17
by: MNNovice | last post by:
Calculate net amount based on conditions ________________________________________ I need to calculate a net amount that is based on FedRatio. Normally the FedRatio is set to be 80% but there are a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.