Change image with radio group

I hope this is a simple one for someone out there.
I need to swap images with a radio group.
I'll post the code here so you have what I have for now.
Obviously I haven't gotten anything working.
Image names to be:
Case_green.png
Case_blue.png
Case_blacklight.png
Case_red.png
<!--START RADIO BUTTONS-->
<!--START RADIO BUTTON SCRIPT-->
<script type="text/javascript">
</script>
<!--END RADIO BUTTON SCRIPT-->
<form name="Colors" method="post" action="">
<table width="358" align="left">
<tr>
<td width="70"><label>
<input name="ColorRadios" type="radio" id="ColorRadios_0"
value="radio_green" checked>
Green</label></td>
<td width="57"><label>
<input name="ColorRadios" type="radio" id="ColorRadios_1"
value="radio_blue">
Blue</label></td>
<td width="105"><label>
<input type="radio" name="ColorRadios"
value="radio_blacklight" id="ColorRadios_2">
Black Light</label></td>
<td width="54"><label>
<input type="radio" name="ColorRadios" value="radio_red"
id="ColorRadios_3">
Red</label></td>
</tr>
</table>
</form>
<p align="left">
<!--END RADIO BUTTONS-->

Mick,
Thanks
William - sorry about the missing quote.
Paul Davis
http://www.kaosweaver.com/
Visit us for dozens of useful Dreamweaver Extensions.
http://www.communitymx.com/
Partner at Community MX - Extend your knowledge
Mick White wrote:
> Paul Davis wrote:
>> this would be something like:
>> <input name="ColorRadios" type="radio"
id="ColorRadios_1"
>> value="radio_blue"
>>
onclick="document.getElementById('swapimageid').src='Case_blue.jpg'>
>
> onclick=
> "document.getElementById('swapimageid').src=
> 'Case_'+this.value.split('_')[1]+'.jpg'"
>
> Mick
> Note: You forgot closing quotes.
>>
>> The image that is getting swapped will need a unique
ID, but that
>> should do it.
>>
>>
>> Paul Davis
>>
http://www.kaosweaver.com/
>> Visit us for dozens of useful Dreamweaver
Extensions.
>>
>>
http://www.communitymx.com/
>> Partner at Community MX - Extend your knowledge
>>
>> William Rickert wrote:
>>> I hope this is a simple one for someone out
there.
>>>
>>> I need to swap images with a radio group.
>>>
>>> I'll post the code here so you have what I have
for now. Obviously I
>>> haven't gotten anything working.
>>>
>>> Image names to be:
>>> Case_green.png
>>> Case_blue.png
>>> Case_blacklight.png
>>> Case_red.png
>>>
>>>
>>> <!--START RADIO BUTTONS-->
>>> <!--START RADIO BUTTON SCRIPT-->
>>> <script type="text/javascript">
>>>
>>>
>>> </script>
>>> <!--END RADIO BUTTON SCRIPT-->
>>>
>>> <form name="Colors" method="post"
action="">
>>> <table width="358" align="left">
>>> <tr>
>>> <td width="70"><label>
>>> <input name="ColorRadios" type="radio"
id="ColorRadios_0"
>>> value="radio_green" checked>
>>> Green</label></td>
>>> <td width="57"><label>
>>> <input name="ColorRadios" type="radio"
id="ColorRadios_1"
>>> value="radio_blue">
>>> Blue</label></td>
>>> <td width="105"><label>
>>> <input type="radio" name="ColorRadios"
>>> value="radio_blacklight" id="ColorRadios_2">
>>> Black Light</label></td>
>>> <td width="54"><label>
>>> <input type="radio" name="ColorRadios"
value="radio_red"
>>> id="ColorRadios_3">
>>> Red</label></td>
>>> </tr>
>>> </table>
>>> </form>
>>> <p align="left">
>>> <!--END RADIO BUTTONS-->
>>>

Similar Messages

  • How to show image in radio group ?

    Hello,
    I tried to add image on my radio group
    select '<img src="/../i/ok.png">' as d, 1 as r from dualBut it's replacing the signs '<' and '>' by "& lt;" and " & gt;"
    Any idea how to avoid html to replace those characters?
    (I'm using Apex 4.0)
    Thanks,
    Uji

    Hi Prabodh,
    I'm trying to put the image in the select list of values.
    I would like to have two columns in my radio group and show 2 different images instead of texts
    Before I had this result instead of an image <img src="/../i/ok.png">In Firebug it is : <label for = "blabla">& lt;img src=&quot;/../i/ok.png&quot;& gt;</label>
    Now with htf.escape_sc I have & lt;img src=&quot;/../i/ok.png&quot;& gt; Kr

  • How to hide/show reports region with radio group selections

    Hi, I have an HTML region with a radio group of two choices (Rpt1 and Rpt2). Also got two other report regions which depend on the radio group selections and by pressing a button it will display records.
    Everything does work perfect BUT say I select Rpt1 and press the report button it will show the records and after that if I select the Rpt2 radio button I still see the result of Rpt1 records. How can I clear or hide the reports regions when I change my radio button selection?
    Thank you
    -iahmadi

    Hi,
    You can create HTML regions that do not need to contain anything at all (use the "No Template" region template to ensure that you don't see a region Title on the page).
    However, in order to get this region to be displayed until the Report button is clicked, you would need to have a hidden page item (called, say, P1_SHOW_REPORT) that has, as a default, 0 as a value. The branch that is triggered by the Report button would then set this item to 1 - so, 0 = hide and 1 = show
    On your page you should have a branch that is conditional on the Report button being clicked. On this branch, set the first "Set these items" to P1_SHOW_REPORT and "With these values" to *1*. You should also have a branch on the page that is unconditional - meaning that it can be triggered by anything that submits the page. Firstly, this branch should have a high Sequence Number (say, 99) and secondly, should should set the value of P1_SHOW_REPORT to *0*. So the Report button sets it to 1 and anything else (which will include the radio button selections) will reset it to 0.
    Now, on your regions you have to change the conditions slightly as we now have two conditions to check - which report has been selected and whether or not the Report button has been clicked.
    This can be done by using a SQL Exists condition of something like:
    SELECT 1 FROM DUAL WHERE :P1_SHOW_REPORT = 1 AND :P1_RADIO = 'ABC'(where ABC is the value for the radio button for the report
    The "blank" region would also have a condition - that would be a simple Item = Expression 1 condition of P1_SHOW_REPORT = 0
    Andy

  • Changing images with c#

    Hi,
    I am making a slotmachine. I have everything but only need an animation for changing the images. This is what i got(only the code for the animation). I can change 2 images but don't know how to do it with multiple images like 5.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    namespace animatie
        public partial class Form1 : Form
            public Form1()
                InitializeComponent();
                Timer t = new Timer();
                t.Interval = 100;
                t.Tick += new EventHandler(t_Tick);
                t.Start();
            bool one;
            void t_Tick(object sender, EventArgs e)
                Image img;
                if (one) img = imageList1.Images[0];  
                else img = imageList1.Images[1];                      
                one = !one;
                pictureBox1.Image = img;

    Since it seems like you have it working for 2 images then expanding it to any # of images is straightforward. It looks like you're trying to animate the spinning wheel on the slot machine so that is the basis I'm working against.  I'm also assuming
    you want to stick with the image list but there are other approaches as well.
    Firstly make sure your images are all in the image list. Next I would recommend that you move the timer start logic out of your constructor.  You don't want it running when the form is created because it hasn't even been displayed yet.  If you
    want the spinning to start as soon as the form is displayed then override the OnLoad and start the timer at that point.  I would recommend that you move this functionality into a separate method because you'll probably want to be able to spin the wheels
    by clicking a button as well. 
    Since you're using an image list you'll need to keep track of the "current" image.  To do that a simple image index field should be fine.  Each time the timer fires you increment the index by 1.  If it gets to the end of the list
    (>= count) then reset it to 0.  Then set the PictureBox image to the image at that index.  This gives you the wrapping logic you want.  It won't give you a smooth transition image though, each image will basically just pop up. 
    If you want a smooth transition then you might need to look at using a single image with images on it and the timer is simply having the window viewport move "down" the image in a scrolling fashion.  When it gets to the bottom it loops back
    around.  For that kind of implementation a PictureBox is probably not a good idea, you'll want to use a simple custom control that handles its own painting instead.
    Since you'll need to do this 3 times (one for each window) you might consider moving the logic into a custom control that represents a single window, the timer logic, image selection and image list.  You can then use 3 instances on your form to emulate
    the slot machine.  Note that you'll want to add some randomness to the spinning because if each window spins at the same speed you'll always get the same behavior.  Therefore you should probably have each window randomly decide how long and how fast
    to spin to introduce randomness to the spinning.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • Help with Radio Group and Web Service

    Hi,
         I created a Radio Group with Dynamic Entry List (Web Service).  It seems my list keeps coming back empty.  I am on SP10. 
         When I deploy I get warnings that "Entry List is missing output fields mapping.  I think this is a warning only because I don't have my form connected to any other components.  I just want to see the radio group populated. I don't think this is the cause. 
    I see references out there to this "Dynamic List" not working until SP12?  Can anyone add some insight to what is wrong?  unsupported until later?
    Thanks!

    I created a new model and the new model works fine.  Something must be cached.

  • How to change Images with ImageIcon

    Hello everyone, this is my first post on the forums.
    I am struggling at the moment to find a way to change images in my program. I am making a card game and when the user clicks a button it will replace the card he has with another card. I thought the following code would work but apparently it doesnt:
    String cardPathA = "image1.gif";
    ImageIcon imageCardA = new ImageIcon(cardPathA);   //cardPathA for example is image1.gif
    //during the program the user changes cards so it should now show image2.gif
    cardPathA = "image2.gif";
    imageCardA.setImage(cardPathA);The error occurs when compiling and it reads: "+setImage(java.awt.Image) in javax.swing.ImageIcon cannot be applied to (java.langlString)+".
    I have searched all over the internet and I haven't found anything. I would appreciate some help. Thanks :)

    im not really sure i made a quick example to show how I would change the imageIcon in a button, just change the paths for cardPathA and cardPathB for your pictures to get it working.
    The only other thing i can think of is maybe to call repaint() for the components you are trying to change the image?
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class ImageChange extends JFrame implements ActionListener{
             final private String cardPathA;
            final private String cardPathB;
         private ImageIcon myImageIcon;
            private JButton changeCard;
            private int counter;
            private JPanel panel;
            private JButton imageButton;
         public ImageChange(){       
                changeCard = new JButton("Change Button");
                counter = 0;
                cardPathA = "1.gif";
                cardPathB = "2.gif";
                myImageIcon = new ImageIcon(cardPathA);
                imageButton = new JButton(myImageIcon);
            public void makeGui(){
                changeCard.addActionListener(this);
                panel = new JPanel(new BorderLayout());
                panel.add(changeCard,BorderLayout.NORTH);
                panel.add(imageButton,BorderLayout.CENTER);
                this.add(panel);
                this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
                this.pack();
                this.setVisible(true);
         public void actionPerformed (ActionEvent menuChoice){
                counter++;
                if(counter%2 ==0){             
                    myImageIcon = new ImageIcon(cardPathA);
                    imageButton.setIcon(myImageIcon);
                }else{
                    myImageIcon = new ImageIcon(cardPathB);
                    imageButton.setIcon(myImageIcon);
            public static void main(String[] args){
                ImageChange test = new ImageChange();
                test.makeGui();
    }Calypso

  • Issues with report with radio group

    Hi Friends,
    Am new to this apex 4.0,i have created a report using radio group
    select apex_item.radiogroup(1,person_id,'checked',person_id) "select",
    person_id,
    AVAIL_SAL_CERTIFICATE,
    OCCURANCE,
    LAST_AVAILED_DATE,
    REASON,
    EFFECTIVE_START_DATE,
    EFFECTIVE_END_DATE
    from YY_SALARY_CERTIFICATENow my requirement is if i checked the radio button and i pressed the next button in my report,it should redirect to the next page which is a detailed form page ant it should display the corresponding checked report row values.
    both the report and form having the same fields,
    please Someone help me to achieve this...

    hi vee,
    ya vee,actually i used my friend account because i forgot my password.Today only i reset my password so only i posted this issue..
    regards,
    yams

  • Change Images with Web Dynpro Theme Editor

    Hi, I am using the Web Dypnro Theme Editor for the Portal but I can not find where to change the branding image, the masthead image, the banner or things like that. Is there any way to change this things with the theme editor? Thanks
    Regards.

    Hi Pablo,
    These documents might help u out:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3ea0d790-0201-0010-80b8-b680496a3838
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d2b1d790-0201-0010-25b7-d1fb059a8ad9
    Regards,
    Pooja.

  • Change Image with Link Hover

    Does any one know how to do this? I found basic code but I am
    not sure how or what needs to be changed.
    <html>
    <head>
    <script language="JavaScript" type="text/JavaScript">
    function showT(q){
    document.getElementById('ima').setAttribute('src','0'+q+'.jpg')
    <title>Confused</title>
    </head>
    <body>
    <table width="500" border="0">
    <tr>
    <td width="20%"><a href="#"
    onmouseover="showT(0)">pic 1<br>
    <br>
    </a><a href="#" onmouseover="showT(1)">pic
    2<br>
    <br>
    </a><a href="#" onmouseover="showT(2)">pic
    3</a></td>
    <td><img id="ima" src="00.jpg" width="100"
    height="100"></td>
    </tr>
    </table>
    <body>
    I found this on
    http://jdstiles.com/java/hoverchangeimage.html
    I have seen it work and I want to make it work for a client I
    am doing a web site for.
    </html>

    You are trying to do a simple image swap? Just use DW's
    SwapImage behavior
    instead of this third-party stuff.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "BWSC" <[email protected]> wrote in message
    news:fvu41d$7be$[email protected]..
    > Does any one know how to do this? I found basic code but
    I am not sure how
    > or
    > what needs to be changed.
    > <html>
    > <head>
    > <script language="JavaScript"
    type="text/JavaScript">
    > function showT(q){
    >
    document.getElementById('ima').setAttribute('src','0'+q+'.jpg')
    > }
    > <title>Confused</title>
    > </head>
    >
    > <body>
    > <table width="500" border="0">
    > <tr>
    > <td width="20%"><a href="#"
    onmouseover="showT(0)">pic 1<br>
    > <br>
    > </a><a href="#" onmouseover="showT(1)">pic
    2<br>
    > <br>
    > </a><a href="#" onmouseover="showT(2)">pic
    3</a></td>
    > <td><img id="ima" src="00.jpg" width="100"
    height="100"></td>
    > </tr>
    > </table>
    > <body>
    >
    > I found this on
    http://jdstiles.com/java/hoverchangeimage.html
    >
    > I have seen it work and I want to make it work for a
    client I am doing a
    > web
    > site for.
    > </html>
    >

  • Working with radio groups in tabular forms

    Since this isn't documented properly in the help, I figured I'd drop the question here. I have a field in my table that I want populated based on a radio button. I can set up the radio button, but I cannot get it to display based on the value. this is the decode statement I am trying to use
    decode(da.isdefault,
    NULL,htmldb_item.RADIOGROUP(1,da.isdefault,'NULL','Open') ||
    htmldb_item.RADIOGROUP(2,da.isdefault,'0','Preferred') ||
    htmldb_item.RADIOGROUP(3,da.isdefault,'1','Default'),
    1,htmldb_item.RADIOGROUP(1,da.isdefault,'NULL','Open') ||
    htmldb_item.RADIOGROUP(2,da.isdefault,'0','Preferred') ||
    htmldb_item.RADIOGROUP(3,da.isdefault,'1','Default'),
    0,htmldb_item.RADIOGROUP(1,da.isdefault,'NULL','Open') ||
    htmldb_item.RADIOGROUP(2,da.isdefault,'0','Preferred') ||
    htmldb_item.RADIOGROUP(3,da.isdefault,'1','Default')) "Status"
    If NULL, I want "Open" selected, if 1 I want "Default" selected, and if 0 I want "Preferred" selected. Any suggestions on how to get this working properly?
    Thanks,
    Scott

    Anyone have a suggestion for this? My boss wants this set up ASAP. I set all the indexes to the same. My values are all coming up as NULL. Any help would be greatly appreciated.
    Thanks,
    Scott

  • Radio group with URL for image in a table

    I'm trying to display some text and an image for a radio group so the form looks like
    (*) text for item 1 {image for item 1}
    ( ) text for item 2 {image for item 2}
    ( ) text for item 3 {image for item 3}
    I've found these:
    Re: Is it possible to display an image instead of button in a radio group?
    How to show image in radio group ?
    It looks like all I have to do is create a LOV that looks like:
    SELECT {complex stuff that generates the text string, img tag, and URL for image}
      ,DB_PK
    FROM dynamic_view_for_lov -- public synonym
    But, my images are stored in a table.
    I have been able to create an IR using the "Column Format=BLOB" method.
    The SQL for the report looks like:
    select
      db_pk, display_text, image_len, image_clob
    from dynamic_view_for_lov -- public synonym
    And the Number/Date Format for the IMAGE_LEN column is:
    IMAGE:DYNAMIC_VIEW_FOR_LOV:IMAGE_BLOB:DB_PK::::::Inline:Download
    My question:  How do I create the URL for the img tag for the LOV?
    many thanks
    MK

    MikeKutz wrote:
    I think Homer Simpson said it best:  Doh!
    For the person in the future, you have to 'fake create' the Automated Row Fetch process.
    The get_blob_file_src gets all the information from that Process and the column name of the Item Type that is on the same page.
    I forgot where I read about that trick.
    Basically, you create the Automated Row Fetch process, then 'disable' it.
    Same thing with the required Item Type.  Create it as a "File Type", just to tell APEX that it comes from a Database Column,.... then change it to a 'hidden' type.
    You don't have to "fake' it if the application already contains the file upload item and ARF. The assumption is that the application will contain these components in order to maintain the BLOBs and you'll just reference the functional ones.

  • Displaying dynamically changing image: a problem with JLabel.

    Hello! I use NetBeans 5.5 and I develop my GUI with Matisse. I'm rather a beginner in developing GUIs with this editor...
    I'd like to display a dynamically changing image. The idea is: GUI shows the image, that is modified as some computations run in a different thread. App will be run on a single machine.
    I'm trying to display the image as a label's icon. The problem is that my app's frame can be resized - and when it is, the label also resizes. When the label is resized, the image should also be resized - the image should always be of the same size as the label. The problem? I noticed, that it works only when I make my app's bigger. When I try to lower its dimensions, the label's dimensions remain the same. Why the label don't make its size smaller?
    My code works as follows: when app's main frame is resize, the panel (the one, that the label is placed in) is also resized. And, since the label is in the panel, it (should) also be resized. So I wrote all the resize-events handlers (therefore I know that the resize event is sent when my app's frame is resized, and when the panel is resized - but the label is resized only when it grows bigger). In this methods I modify the image displayed in the label (I resize the image).
    Or, perhaps, there is some other way to show a (dynamically changing) image with Swing... I chose JLabel, because I didn't want to write my own JComponent. JLabel can display image and that is all I need. The problem is: when the label grows bigger, I create a new, bigger image (icon). Why my label don't get smaller (the resize event isn't even sent)?

    There is no component that dynamically resizes an image. You need to create your own. Something like this:
    JComponent component = new JComponent()
         protected void paintComponent(Graphics g)
              //  Scale image to size of component
              g.drawImage(yourImage, 0, 0, getWidth(), getHeight(), null);
    };

  • FRM - 40212 / FRM - 40222 error on a radio group during query

    Hi all,
    This is my first post so please bear with me if I haven't provided sufficient information or am unclear at all.
    I'm using Forms Builder (Web) on a 10g Database. I have a number of database and non-database items as part of a data block.
    My problem is that, when I enter a value in any field and click the query button, I get a FRM-40212 Invalid value for field error on my radio group (disabled, non-database item that is programatically populated in the post-query and list-changed triggers only). When I click ok, I get a FRM-40222 Disabled Item Failed Validation error on the same radio group.
    This does not happen if I click the 'Enter Query' button before entering values into fields, however I don't want my users to encounter this error if they try to query without clicking on 'Enter Query' first.
    I'd like to know why exactly does this error happen - what does it mean?
    I've read in other forums that setting the item's Required property to false solves this issue. But how can I do this with a radio group? And if it's not possible, does anyone have any suggestions for other workarounds?
    Thanks in advance,
    Abigail

    Hi,
    You can avoid this by setting 'Mapping of other values' to the one fo the radio buttons value.Like if you have to radio button radio1 and radio2 associated with radio group R1 ,then set any radio buttons initial value to this 'Mapping of other values' property of radio button R1.You won't see this error.
    This error occurs because your loading a screen without assigning a value to the radio button.
    If this helps mark question as answered or helpfull.
    Thanks,
    Pavan.

  • Format radio group layout

    Does anyone know if it is possible to change how a radio group lov displays the lov items? It wants to put them vertically but we want them horizontally..

    I have used the columns property of the radiobutton group
    paul.

  • Read Only Display of Radio group and Text area with counter not working

    Hello,
    I am using Apex 3.2, with 10g for the database
    I have this form, with fields that will set to read only when status = 'closed'
    All of the fields display as read only except for 2. I cannot figure out why this is not working correctly.
    1st field is Issues that is a text area with character counter, with a sql query behind it, that is set to null unless the query is pulling in the data.
    2nd field is Status which is a radio group that will not display as read only when status = 'closed'
    I have other fields on the form with the same format and they change to read only when the status = 'closed', I have even copied the pl/sql expression from one field to these fields and it still doesn't work correctly. I have also tried javascript for an on load event, which works, but once I click on the save button, it disables all of the page items, which works correctly, but I purposely forget to enter information, to make sure the validations are firing correctly, which it does, but the script disables everything, not allowing me to correct the errors. The javascript is firing on the on page load event.
    Any help on this is greatly appreciated.
    Mary

    Dung,
    That API seems to have a bug, it returns true/false/null, so you could use 'return not nvl(htmldb_util.current_user_in_group(p_group_name => 'APP Admin'),false)' to get a false value.
    Unfortunately there's another problem: using the read-only attributes for checkbox or radiogroup item makes them hidden. My suggestion would be to create another item that has disabled="disabled" in the HTML Form Element attribute in the item definition and display that item or the non-disabled item alternately, using conditions based on the current_user_in_group logic.
    Scott

Maybe you are looking for