PHP - show image next to option

Is it possible via javascript/jQuery to select an image option (see below) and then have the image associated with the <option> show next to the <select> tag?
<select name="images" id="images">
<option>Select Image</option>
<option value="one.jpg">one.jpg</option>
<option value="two.jpg">two.jpg</option>
<option value="three.jpg">three.jpg</option>
<option value="four.jpg">four.jpg</option>
<option value="five".jpg>five.jpg</option>
</select>
<img src="http://www.DomainName/imageOptions/nameOfImage.jpg" width="200" height="200" alt="" />
I could probably do it with php by getting the option value but that means I'd have to submit the page first, which I'm trying to avoid. javascipt might be able to do this onclick?
Cheers
Os

Hummm...the only issue I see is that I have about 100 images. Does that mean I have to create 100 variables?
var ddData = [
        text: "Facebook",
        value: 1,
        selected: false,
        description: "Description with Facebook",
        imageSrc: "http://dl.dropbox.com/u/40036711/Images/facebook-icon-32.png"
        text: "Twitter",
        value: 2,
        selected: false,
        description: "Description with Twitter",
        imageSrc: "http://dl.dropbox.com/u/40036711/Images/twitter-icon-32.png"
        text: "LinkedIn",
        value: 3,
        selected: true,
        description: "Description with LinkedIn",
        imageSrc: "http://dl.dropbox.com/u/40036711/Images/linkedin-icon-32.png"
        text: "Foursquare",
        value: 4,
        selected: false,
        description: "Description with Foursquare",
        imageSrc: "http://dl.dropbox.com/u/40036711/Images/foursquare-icon-32.png"

Similar Messages

  • Combo/list box image next to option

    Hi,
    I'm trying to display an image (small icon) within a drop
    down/combo/list box in a form. I've not found a simple way of doing
    it and wondered if anyone could advise of an easy way to do this
    seemingly simple task ?
    The result I'm after can be seen here:
    http://dhtmlx.com/docs/products/dhtmlxCombo/index.shtml
    of the five combo boxes displayed I'm after the 'combo box
    with icons' result. The method used on this page to acheive the
    effect seems a bit overkill for my requirement, otherwise I'd
    try/use it. I've looked at the page source, but nothing is revealed
    regarding the html/css used to do it.
    I'd appreciate anyone advising a simple way to do this.
    Many thanks.

    If your page is asp then the code below will do what you
    want. Now when a
    user selects a country then that country id will be entered
    into a cookie.
    then when the user goes to other pages on your site you can
    have if else
    statements to show language of your choice.
    if you need the country flag icons go to ip2location.com they
    will give them
    for free.
    <form action="" name=langswitch style="display:
    inline;">
    <table cellpadding=0 cellspacing=0 style="float:right;
    margin-top:-14px;"><tr>
    <td style="padding-left: 3px; padding-right:
    3px"><img
    src="/images/flags/<%= Request.Cookies("country")
    %>.gif" width="14"
    height="11" border="0"></td>
    <td><select name="langcountry"
    onchange="document.forms.langswitch.submit()">
    <option value="uk" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("uk" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>English
    <option value="es" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("es" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>Espa&ntilde;ol
    <option value="de" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("de" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>Deutsch
    <option value="fr" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("fr" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>Fran&ccedil;ais
    <option value="it" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("it" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>Italiano
    <option value="br" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("br" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>Portugu&ecirc;s (Br)
    <option value="hu" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("hu" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>Magyar
    <option value="ru" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("ru" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>Ð
    ÑfÑ?Ñ?кий
    <option value="jp" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("jp" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>æ-¥æo¬èªz
    <option value="kr" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("kr" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>í.oêµì-´
    <option value="cn" <%If (Not
    isNull(Request.Cookies("country"))) Then If ("cn" =
    CStr(Request.Cookies("country"))) Then
    Response.Write("selected=""selected""") :
    Response.Write("")%>>ä¸æ-?(ç®?ä½")
    </select></td></tr>
    </table>
    </form>

  • I'm getting a notice on my iPad saying...Provisioning Expiration "Lynx Enterprise Release" expires in 3 days...show or remind. Option are verify or remove...which I am hesitant to do because the icon it shows next to it is the one for "settings".

    I'm getting a notice on my iPad saying...Provisioning Expiration "Lynx Enterprise Release" expires in 3 days...show or remind. Option are verify or remove...which I am hesitant to do because the icon it shows next to it is the one for "settings".

    Why is that making you hesitate?  You can't accidentally remove any of the built-in apps, that I'm aware of.

  • My thumbnails are not showing up next to the icons in finder.  Also the back arrow and forward arrow as well as the list options don't show up.  Any suggestions how to get them back?

    In my Finder window, the picture icons that usually show up next to the items are not there.  i.e. in my sidebar, the little pictures that are usually by the Application, Desktop, Documents, etc items.  Also, the back and forward arrows, list items and tasks don't show as well.  Any ideas on how to get them back?

    Hello AgentScaber,
    You'll likely need to reinstall Mountain Lion.
    OS X Mountain Lion: Reinstall OS X
    http://support.apple.com/kb/PH10763
    Cheers,
    Allen

  • Flash Builder 4.5 for PHP - show variable from PHP in app

    I have searched for hours and I can't figure this out…
    Is there a way to somehow "echo" my PHP code in my MXML file ?
    I know you can't echo something from PHP to MXML, so here's what I have done :
    I get my informations from my database, I need to show an image and its title, so I put the following code in a variable :
    <mx:Image id="laniraBlanche" x="25" y="65" width="210" height="126" source="'.$row->image_mini.'" click="selectLaniraBlanche()" rollOver="seePicture()" rollOut="outPicture()" />                                              <s:Label x="25" y="155.85" text="'.$row->nom.'" width="210" textAlign="center" height="37" fontSize="19" backgroundColor="#676666" verticalAlign="middle" fontFamily="Georgia" color="#FFFFFF" click="selectLaniraBlanche()" rollOver="seePicture()"  id="laniraBlancheTxt" rollOut="outPicture()" />'
    Then, I return that variable.
    I find the function where my var created is returned from the "Data/Service" tab, I am on Design mode on Flash Builder, and I "drop" my function where I want my image and text to show on my app.
    I tryed dropping it in a "group", it doesn't show anything. I tryed several other options, and nothing worked.
    So my question is, how could I have this code created in PHP show on my application ?
    Thank you  for your help

    I also have Flash Builder 4.5 for PHP and the ANT view does not show when going to Window -> Show View --> Other.  I could not find it in any of the folders.
    However, I was able to add it by hitting Command 3 (CTRL 3 on PC) and typing Ant.

  • Help using ItemRenderer to show images based on digits in DataGrid model

    Hi there,
    Disclaimer: this is my very first attempt at Flex!
    I found rummaging online, some documentation about
    ItemRenderers. I have a datagrid pulling info from a PHP Ajax
    backend successfully. One of the columns retrieves a digit only (1,
    2, or 3 ).
    I've read that I can create a CellRenderer by creating a
    mxml file for the renderer (StatusRenderer.mxml), adding this to my
    <mx:DataGridColumn specification:
    itemRenderer="StatusRenderer"
    where my StatusRenderer.mxml right now contains only:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="32" height="32">
    </mx:Canvas>
    It displays a blank square as expected.
    so now, how do I make it show images/open.gif,
    images/closed.gif or images/deferred.gif based on status, 1, 2, or
    3 respectively?
    Not sure how actionscript blends into components this way..
    Thanks in advance!
    Alex

    Hi Vikas,
    Thanks for sharing.
    " [Not sure if one technique has any performance advantages over the other]"It seems to me that in your technique it should be simpler to maintain several gif options – editing LOV seems simpler then editing the DECODE parameters list. I'm also thinking about the option of using dynamic LOV for gifs stored in a table.
    Regards,
    Arie.

  • CRS 10.1 with Endeca 3.1.1 -home page doesn't show image and promo products

    Thanks to this forum and especially cmore I'm close to setting up my local dev environment, but still have something to resolve.
    I have ATG 10.1.2 + CRS + Endeca 3.1.1. I installed BCC with Staging and Production (switchable) stores.
    The problem is with Production CRS - both US Store and Home Store don't show image and promoted products on Home page.
    What I see below Top Category pane is empty square. Unlike Production, home page on Stage works fine - I see homepage_promo_storeSiteUS_en_anonymous.png and promoted products.
    I think the problem is not related to Endeca, as I currently connect both Stage and Prod to the same Endeca CRS, I also believe that issue is not related to configuration - I tried to run production with Stage configuration, and it changed nothing. I believe the issue is somewhere in data (DB) - but I did full deployment for Prod and it didn't help. I verified targeters and slots on Prod through ACC, and they looks fine. So don't know at this point what to do next.
    While doing full deploy I see some errors in the log which might be related to the issue, But the same errors I see on Stage as well and still Stage works without issues:
    10:17:41,805 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/HomeTheme in scope global. It is defined in scope request
    10:17:41,811 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/PromotedProduct1 in scope global. It is defined in scope request
    10:17:41,816 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/PromotedProduct2 in scope global. It is defined in scope request
    10:17:41,819 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/PromotedProduct3 in scope global. It is defined in scope request
    10:17:41,822 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/FeaturedProduct2 in scope global. It is defined in scope request
    10:17:41,826 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/FeaturedProduct3 in scope global. It is defined in scope request
    10:17:41,829 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/FeaturedProduct4 in scope global. It is defined in scope request
    10:17:41,832 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/FeaturedProduct5 in scope global. It is defined in scope request
    10:17:41,836 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/FeaturedProduct1 in scope global. It is defined in scope request
    10:17:41,839 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/CategoryPromotionContent2 in scope global. It is defined in scope request
    10:17:41,842 ERROR [nucleusNamespace.] Invalid attempt to resolve component /atg/registry/Slots/CategoryPromotionContent1 in scope global. It is defined in scope request
    Last update: I compared Stage and Prod home pages HTML code, and notice that the first difference between two pages is absence of endeca-slot Div, the below code present on Stage, and is Not present on Prod:
    It is the first difference only , there are a bunch more.
    &lt;div class="endeca-slot" zone="/content/Shared/Global Search Configuration/Search Box"&gt;
    <script type="text/javascript">
    if(Endeca.Site) {
    Endeca.Site.Audit.contents["/content/Shared/Global Search Configuration/Search Box"] = [{"@type":"SearchBox","endeca.internal.created.by":"admin","rule.msg":"Fired","endeca.internal.last.modified.by":"admin","rule.msgcode":"13","rule.state":"fired","endeca.internal.resource.path":"\/sites-live\/NYCoCRS\/content\/Shared\/Global Search Configuration\/Search Box\/Search Box","endeca.internal.workflow.state":"ACTIVE","type":"DGraph.MerchDebug","Title":"Search Box","rule.id":"1","endeca.internal.last.modified":"2013-03-20T11:43","endeca.internal.date.created":"2013-03-20T11:43","Zone":"\/content\/Shared\/Global Search Configuration\/Search Box"}
    </script>
    Edited by: PKU on Apr 1, 2013 8:32 AM
    Edited by: PKU on Apr 1, 2013 8:35 AM

    After some analysis and experiments:
    Most likely the issue is with Scenarios. HomeTheme Slot is populated by Theme scenario.
    For some reason the slot remains empty on "bad" environment. On "good" environment the slot contain promo content item after the first call of the slot. I checked respective targeter and promo content item, and they look OK, so I believe something wrong with Scenarios.

  • Apache: showing images in ascending order by name

    hi:
    i have several detail pages where i show images contained in
    a folder:
    $folder = dir($path);
    while ($folderEntry = $folder->read()){
    if ($folderEntry <> "." && $folderEntry
    <> ".." &&
    substr($folderEntry, -6, 2) <> "00") {
    echo '<li><img src="'.$path.$folderEntry.'"
    /></li>';
    $folder->close();
    in the local server they appear in the way i want, in
    ascending order by
    name (img_01.jpg, img_02.jpg, img_03.jpg, ...) but in the
    remote server
    they appear in, apparently, random order
    i activated FancyIndexing in the httpd.conf file but it
    doesn't solved
    the problem:
    # Directives controlling the display of server-generated
    directory
    listings.
    # FancyIndexing is whether you want fancy directory indexing
    or
    standard
    IndexOptions FancyIndexing
    # End of indexing directives.
    i know i can store the filenames names in an array an sort it
    but i
    prefer to control it in the server
    local (OS X 10.4.10)
    Apache/1.3.33 (Darwin) PHP/5.1.6
    remote (Red Hat Linux 2.6.9-34.ELsmp)
    Apache/2.0.52
    tia,
    jdoe

    Templeton's suggestion is best if needing help with Microsoft Entourage. Since I know the answer is "not possible" I can at least steer you toward an AppleScript that will give you a workaround. Have a look here <http://www.barryw.net/weblog/files/category-5.html>.
    Further questions about this script should be directed either to its author or to Microsoft's Entourage newsgroup <http://groups.google.com/group/microsoft.public.mac.office.entourage>.
    Hope this helps! bill
    1 GHz Powerbook G4   Mac OS X (10.4.9)  

  • IPad not showing up as Preview Option in Folio Builder

    I'm currently using Adobe DPS (Windows), and trying to preview my folio in an iPad. I've got the Content Viewer app open on the iPad, am signed in, and am also signed in in Folio Builder. And of course, I've got the iPad plugged into the computer. After plugging in the iPad, an arrow appears next to Preview, which I assume would have been the iPad showing up as an option. But on clicking the arrow, I only get the option to open the content viewer on my desktop. Has anyone experienced this issue?

    Preview on Device for the iPad/iPhone works only on Mac OS computers, not Windows. If you sign in to the Adobe Content Viewer on the iPad using the same Adobe ID used to sign in to the Folio Builder panel, you can download your folios from the cloud.

  • Why are my desktop fonts not showing up as an option to use in Muse anymore?

    Why are my desktop fonts are not showing up as an option to use in Muse anymore? I know that my desktop fonts are not web safe and will export as an image... But I would still like to have them as an option. Why did this start with the latest release? I cannot find anything in the preferences or menus to make them show up as an option. I am running OSX 10.9.4 and Muse 2014.0.1.30 CL785017. Please help!!!

    Hello,
    Could you please try the following:-
    Reboot in safe mode by pressing the SHIFT key (it takes a while) so the OS clears the font cache.
    Reboot then in normal mode and the fonts should show properly.
    Regards,
    Neha

  • Show image quality as like original image after resize in as3.

    Hi Guys,
    I am working on a Action Script3 project and i am showing images after resizing. I am using Bitmap and BitmapData manipulation for this but not getting image quality as like original image.  Please guide and help me with code that how can i do this.
    Thanks & regards
    Rangrajan

    How are you resizing? Normally, you would draw the original bitmap data into the new bitmap data, using a matrix to resize. To smooth scale, you need to use the smoothing option of the draw method. Here's a little sample that takes a library image and scales it to 500x500, using smoothing:
    var orig:BitmapData = new baseMap(); //library image
    var res:BitmapData = new BitmapData(500,500);
    var m:Matrix = new Matrix();
    m.scale(res.width / orig.width, res.height / orig.height);
    res.draw(orig, m, null, null, null, true);
    var c:Bitmap = new Bitmap(res);
    addChild(c);
    toggle the true to false in the draw, to see the difference...

  • Finder doesn't show image dimensions

    Hi!
    I have a problem with image dimensions in Finder. Finder doesn't show image dimension info in preview column and Get Info window. But when I open in Preview app I can see dimensions in Get Info window. How to solve this problem. If I want to sort images by dimension, I can't do that. Because Finder doesn't know image dimensions. You can see images below.

    Terence Devlin wrote:
    That's because the Finder is a file manager and works from file metadata. The data you're seeking is about the file contents. You need to use a Photo Manager or Browser.
    There is someone who can sort images by dimensions and see dimensions in list view. Also if Finder will not show image dimensions, why give me "Dimensions" and "Resolution" option to select in list view.
    VikingOSX wrote:
    Launch a Finder window. Press command+J, and set Show Item Info. Now the image dimensions will show below each image icon. If it is a movie, then the duration of the movie is shown.
    I have done this. But doesn't show information.

  • Bridge does not show image previews anymore on one of my drives

    Bridge isn't showing image previews on one of my drives. I have tried resetting the preferences as well as deleting the cache to no avail.

    I don't believe so, because it operates as expected in finder. It's only bridge that doesn't seem to want to create the thumbnails. I went to the thread you posted, Robert, but unfortunately I'm not on Windows and don't see any "online" or "offline" options.
    Transporter is not a cloud service. It's actually a local hardware device, so it's more a network drive than anything else.

  • Show image in browser

    hi,
    i am new in PHP and oracle. can i show image in browser using image path from database?

    vikash wrote:
    No, Actually I m putting the path of image in database in varchar2 and i want to show image in browser using this path...plz helpGotcha - that actually makes life a little easier...
    What you'll want to do with PHP (I'll lay this out for you a bit - I don't have a code editor/environment handy at the moment..)
    1) You'll retrieve your image path from the database. Note that this path has to be the 'web accessible path', not a full file system path. (e.g. if your "Web Root" is /var/http/www and the full file system path to your image is /var/http/www/images/myimage.png, then the image you should have in the database is /images/myimage.png. This could also be a relative image path, etc.)
    2) Use your retrieved database path to insert into your HTML <img/> tag. If you have 'short tags' enabled, it should look something like this:
    <img src="<?= $myImagePath ?>" />
    That's the basics - is there anything here that sounds familiar?

  • N95 8GB - Showing images from applications in the ...

    Hi, I have an N95 8GB (2), I have recently installed GarminXT and the image gallery is now showing images used in GarminXT in the Gallery.
    Is there a way to disable the GarminXT folder from being accessed by the Gallery.
    Many thanks
    Jym
    Solved!
    Go to Solution.

    Hi, I found a way of doing it, although it is a bit slow as you have to hide one image at a time.
    Here is a link to the guide http://www.simplysymbian.com/2007/07/02/how-to-hid​e-gallery-images/
    And the download link for Y-Browser is dead so here is a working link http://www.allaboutsymbian.com/software/item/Y-Bro​wser_for_S60_3rd_Edition.php
    Hope this helps
    Jym

Maybe you are looking for

  • I can't download an epub book to my ereader

    I've been purchasing books from kobo & I have to make sure they are a drm book coz if they are only a epub file it will open up in my library on adobe digital edition but when I go to where all my downloaded books are it doesn't seem to come across s

  • Skype notifications problem with dual monitors

    A few days ago I did a fresh install of arch on my laptop (intel graphics) and since then when I am using 2 monitors, one 1366x768(primary-right) and the other 1920x1080, Skype notifications that are supposed to be shown on the primary monitor do not

  • File opening multiple times in a book

    Hello. Something has gone crazy in indesign for me. Not sure if its the recent update. In osx if you open a book and double clikc one of the files, it opens, if you double click it again, it opens another copy, changes made in one reflect in the othe

  • Moving downloads to a new PC

    I have purchased Adobe Professional for another PC, unfortunately that PC has died and I want to get Adobe on to this PC, any ideas?

  • ITunes Store Error 8003

    I was downloading extras for a movie of mine and got error 8003. My network is fine, iTunes has full access to the Internet; if it didn't the movie wouldn't download would it? Really trying to avoid messing with my system configuration (Windows 7). I