473,396 Members | 1,879 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,396 software developers and data experts.

Dropdown Image Selection from db

Fary4u
273 100+
Hi

i'm trying to change image via selecting from dropdown list, the only problem is it's taking value from database but with out ".jpg" string here is my coding

Expand|Select|Wrap|Line Numbers
  1.     <select id="cboColours" name="drpcolor" onChange="showimage()">
  2.     <option selected value="1">Make Selection</option>
  3.     <%=PopulateCombo(rsColours,"comboName","comboName")%>
  4.     </select>
  5.     <script>
  6.     function showimage()
  7.      {
  8.       if (!document.images)
  9.        return
  10.        document.images.pictures.src=
  11.        document.form1.drpcolor.options[document.form1.drpcolor.selectedIndex].value
  12.      }  
  13.     </script>
  14.     <img src="color/<%= comboName %>.jpg" name="pictures" >
  15.  
RESULT LIKE CAME UP LIKE THIS
<img src="color/<%= comboName %>" name="pictures" >
how can i display including .jpg string with changing value
Jan 20 '09 #1
3 1649
acoder
16,027 Expert Mod 8TB
Can you post the generated HTML code? i.e. what's the result of PopulateCombo()?
Jan 20 '09 #2
Fary4u
273 100+
@acoder
<img src="" name="pictures" >
Jan 22 '09 #3
acoder
16,027 Expert Mod 8TB
No, I meant line 3. Give me some examples of options in your select element.
Jan 22 '09 #4

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

Similar topics

9
by: Da Costa Gomez | last post by:
Hi all, I was wondering whether it is possible to create (probably with the help of css) a dropdown list with the following structure. < > The stuff between the <..> are the visible items....
10
by: JL | last post by:
Does anyone have any ideas on this please? I don't know how to evaluate the no-blank selections against each other from a form as follows: . I have a form with 6 dropdown fields, each...
2
by: Nick Calladine | last post by:
Is this possible to ... I wish to get the value of a dropdown select but gets is indexable value (dont know if that is the right term) if that is possible (the position it assigned get assigned...
4
by: anonymous | last post by:
Hi Folks, I have a form with two Dropdown list boxes, which get loaded with data from Database. DropDownList1 gets data from Table1 and DropDownList2 gets data from Table2 Table1 has a...
0
by: Jeff | last post by:
After I bind the repeater control in the form_load event, it builds multiple lines based on the number of rows in the dataset. In the repeater control, I have a textbox and a dropdown list box. ...
2
by: 23s | last post by:
I have a dropdown bound to a dataview. The binding assigns the dropdown with a SelectedIndex of 0. There is a msgbox in the SelectedIndexChanged event that displays the SelectedIndex property....
4
by: Ahmed | last post by:
Hi everyone, Is there a way to add a toolbarbutton with dropdown menu similar to the mail button in IE? In another word, when the chevron is part of the button not beside it. Thanks Ahmed
3
by: Cagey | last post by:
What I'm trying for: If this selection or if click on selection (highlighted line choice/ which ever selection change) w/in query's combo dropdown list box (on Switchboard), then Open in...
3
by: er1 | last post by:
Hi all, I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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...
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.