How to use javascript to edit image name ?

I have 2 regions.
In the 1st region I have "Select List with Redirect" so when I select the item in the list then I get the value of 1,23,.... etc for variable P2_X_COMP and it reloads the same page.
Now in the 2nd region, i am trying to diaplay a image.
< img src="/i/1.jpg" WIDTH=120 HEIGHT=160
so I wanted to make that dynamic and at run time depending the item selected in list selected from region 1, I wanted to have images dynamically in region 2.
so something like if value of P2_X_COMP is 1 then
img src="/i/1.jpg" WIDTH=120 HEIGHT=160
else if value of P2_X_COMP is 2 then
img src="/i/2.jpg" WIDTH=120 HEIGHT=160
else if value of P2_X_COMP is 3 then
img src="/i/3.jpg" WIDTH=120 HEIGHT=160
how do i do that ?
Regards,
Nikhil

Hi Nikhil,
In Region Source of you page please enter something like this: < i m g src="/i/1.jpg" width="120" height="160" id="MY_IMAGE">For HTML Form Element Attributes: onchange="javascript:changeImage(pThis.value);"
In HTML Header of your page you enter the following code:
<script type="text/javascript">
function changeImage(pSelect)
  var img = document.getElementById('MY_IMAGE');
  switch (pSelect)
    case "1":
       img.src = '/i/1.jpg';
       break;
    case "2":
       img.src = '/i/2.jpg';
       break;
    case "3":
       img.src = '/i/3.jpg';
       break;
    default:
       img.src = '/i/1.jpg';
       break;
</script>I've not tested this, so maybe you have to make changes.
chrissy

Similar Messages

  • How do I save an edited image back to my iPhoto gallery?

    How do I save an edited image from Elements back into my iPhoto gallery?

    You have two options:
    1. Set PSE as your external editor, send the photo from iphoto, work on it in PSE and save it without changing the name or format (you don't want to see the Save As window) and iphoto will remember your original + last saved version, although you'll have to lose the edits to see the original again. This doesn't work for raw files and you will probably need to set the Editor preferences>saving files>on first save to save over existing to get it to work for other formats.
    2. Export the photo to the desktop, use file>open in PSE, make all the changes you want, save the file in any format with any name you like, then import the edited photo to iphoto as a new file.

  • How to use JavaScript in Web bean generated JSP

    I want to do some simple JavaScript validations (for example, checking if a particular field is empty) in the JSP page rendered by the data web bean. Because the HTML is rendered by the bean, I'm not able to refer to the HTML controls in the JSP page. I'm not even able to refer to the form with the following standard piece of JavaScript code - "document.forms[0].control_name".
    Is anybody aware of how to use JavaScript with these rendered JSP pages?

    You just have to add it like and applet , including this line in your JSP or JSF
    <script src="http://dl.javafx.com/dtfx.js"></script>Then add the applet
    <script>
        javafx(
                  archive: "./resources/jar/Draw.jar",
                  width: 400,
                  height: 200,
                  code: "Draw",
                  name: "Draw"
    </script>./resources/jar/Draw.jar - is the path and the name of the jar

  • How to use the default database service name on creating procedure for data

    how to use the default database service name on creating procedure for datagaurd client failover ??? all oracle doc says create a new service as below and enable at DB startup. but our client is using/wanted database default service to connect from application on the datagaurd environment (rac to non rac setup).please help.
    Db name is = prod.
    exec DBMS_SERVICE.CREATE_SERVICE (service_name => 'prod',network_name =>'prod',failover_method => 'BASIC',failover_type => 'SELECT',failover_retries => 180,failover_delay => 1);
    says already the service available.
    CREATE OR REPLACE TRIGGER manage_dgservice after startup on database DECLARE role
    VARCHAR(30);BEGIN SELECT DATABASE_ROLE INTO role FROM V$DATABASE;
    IF role = 'NO' THEN DBMS_SERVICE.START_SERVICE('prod');
    END IF;
    END;
    says trigger created, but during a swithover still the service is listeneing on listener.
    tns entry.
    prod =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (LOAD_BALANCE = YES)
    (ADDRESS = (PROTOCOL = TCP)(HOST = prod1)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = prod2)(PORT = 1521)) ---> primary db entry
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = proddr)(PORT = 1521)) --> DR DB entry
    (CONNECT_DATA =
    (SERVICE_NAME = prod)
    thanks in advance.
    Edited by: 854393 on Dec 29, 2012 11:52 AM

    Hello;
    So in the example below replace "ernie" with the alias you want the client to use.
    I can show you how I do it :
    First an entry need to be added to the client tnsnames.ora that uses a SERVICE_NAME instead of a SID.
    ernie =
    (DESCRIPTION =
        (ADDRESS_LIST =
           (ADDRESS = (PROTOCOL = TCP)(HOST = Primary.host)(PORT = 1521))
           (ADDRESS = (PROTOCOL = TCP)(HOST = Standby.host)(PORT = 1521))
           (CONNECT_DATA =
           (SERVICE_NAME = ernie)
    )Next the service 'ernie' needs to be created manually on the primary database.
    BEGIN
       DBMS_SERVICE.CREATE_SERVICE('ernie','ernie');
    END;
    /After creating the service needs to be manually started.
    BEGIN
       DBMS_SERVICE.START_SERVICE('ernie');
    END;
    /Several of the default parameters can now be set for 'ernie'.
    BEGIN
       DBMS_SERVICE.MODIFY_SERVICE
       ('ernie',
       FAILOVER_METHOD => 'BASIC',
       FAILOVER_TYPE => 'SELECT',
       FAILOVER_RETRIES => 200,
       FAILOVER_DELAY => 1);
    END;
    /Finally a database STARTUP trigger should be created to ensures that this service is only offered if the database is primary.
    CREATE TRIGGER CHECK_ERNIE_START AFTER STARTUP ON DATABASE
    DECLARE
    V_ROLE VARCHAR(30);
    BEGIN
    SELECT DATABASE_ROLE INTO V_ROLE FROM V$DATABASE;
    IF V_ROLE = 'PRIMARY' THEN
    DBMS_SERVICE.START_SERVICE('ernie');
    ELSE
    DBMS_SERVICE.STOP_SERVICE('ernie');
    END IF;
    END;
    /lsnrctl status - should show the new service.
    When I do this the Database will still register with the listener. I don't give that to the clients. That one will still be available but nobody knows about it. Meanwhile "ernie" moves with the database role.
    So in my example the default just hangs out in the background.
    Best Regards
    mseberg
    Edited by: mseberg on Dec 29, 2012 3:51 PM

  • How to use radioButton(s) and image controls on windows phone 8.1

    how to use radioButton(s) and image controls on windows phone 8.1

    Hi aspirantme,
    >>how to use radioButton(s) and image controls on windows phone 8.1
    Which version of your app is? Runtime or Silverlight?
    For Runtime version, please see the following articles:
    #RadioButton class
    https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.radiobutton(v=win.10).aspx
    #How to add radio buttons (XAML)
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868200.aspx
    #Image class
    https://msdn.microsoft.com/library/windows/apps/br242752.aspx
    For Silverlight version, please refer to the following documents and guidelines:
    #RadioButton Class
    https://msdn.microsoft.com/en-us/library/windows/apps/system.windows.controls.radiobutton(v=vs.105).aspx
    #RadioButton control design guidelines for Windows Phone
    https://msdn.microsoft.com/en-us/library/windows/apps/hh202881(v=vs.105).aspx
    #Image Class
    https://msdn.microsoft.com/en-us/library/windows/apps/system.windows.controls.image(v=vs.105).aspx
    #Quickstart: Images for Windows Phone
    https://msdn.microsoft.com/en-us/library/windows/apps/jj206957(v=vs.105).aspx
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Help me!! How to use JavaScript with JSP ??

    I am using JDeveloper and I created a screen in JSP which uses a bean for database connectivity and retriving info onto the page.
    The page has a ListBox where list items are populated from the database.My requirement is
    whenever the list is changed the page shuold be refreshed with the selected item info.
    I tried to use 'JavaScript' for triggering the event with 'onChange' event of the ListBox.But the event is not getting invoked. I think JavaScript is not working with JSP.
    Please help me with how to Use javaScript with JSP or any other alternative where I can meet my requirement.
    I have one more question...I have gone through the JSP samples in OTN and I am trying do download the sample 'Travel servlet' which show list of countries...etc
    I have also gone through the 'readme' but I don't know how to extract .jar file.
    I would be great if you could help me in this.
    Thanks!!
    Geeta
    null

    We have a similar need. We have used Cold Fusion to display data from Our Oracle Database. We have a simple SElect Box in HTML populated with the oracle data. When someone selects say the State of Pennsylvania. then we have an On change event that runs a Javascript to go get all the cities in Pennsylvania.
    Proble we are having is that inorder for the Javascript to work , we currently have to send all the valid data.
    Do you know of any way to dynamically query the the Oracle database in Javascript

  • How to use Javascript to load random pages?

    I wonder if anyone knows how to use Javascript to load a list
    of links stored in the text file.
    Every address will take a line, and the Javascript will
    randomly select one of the addresses to load.
    The user will click the button "random" and access the page
    randomly selected by the script.

    Addition note:
    I forgot to say this because my computer froze......(how
    lame)
    I got the code for random accessing the links.
    But now the problem is, is there anyway to parse a text file
    into the array in Javascript?

  • How to Use JavaScript in Controller Class...

    Hi All,
    Can any one tell me how to use JavaScript in Controller Class.
    Requirement is:
    I have
    Radio Group(RG1),
    Two Radio Buttons(RB1,RB2),
    Two messageTextInput(MTI1,MTI2),
    if i click RB1 i should Prompt to the end user to "Enter value for MTI1" or
    If i click RB2 i should prompt "Enter value for MTI2" while submitting page.
    Please let me know the steps to use JavaScript and the above client validation...
    Regards
    Alem...

    Using javascript is against the standard. I can tell you a workaround instead of you setting the javascript, check if that would be acceptable.
    You can use PPR and set the required property on the messageTextInput on clicking of the radio button. By doing this you will let UIX generate the javascript for you to handle the client side validation. But the validation will happen only on click of the submit button. The visual indicator is good enough to tell that the value has to be entered to the item.

  • How to use Javascript in OBIEE?

    Hi all,
    can any one tell how to use javascript in OBIEE. i.e steps to follow to insert the javascript in OBIEE 11g or 10g

    If you are trying to display total number of pages in a report, Add the below formula in the column of the report and hide that column in the report.
    FX = sum(count(1))/25
    You can then reference the column in the narrative view like this: "Total pages in the report are @5" and out put may be "Total Pages in the report are 30".
    Or
    You can also use something like the below:
    To calculate them use fi:
    CEILING(CAST(RCOUNT("FactColumn In the Report (Sum All)") as DOUBLE)/ 25) for the page number
    CEILING(CAST(COUNT("FactColumn In the Report (Sum All)") as DOUBLE)/ 25) for the total pages
    Put the above formula in the column and reference it in the narrative view like I mentioned in the previous example.
    If you are report view is pivot, then please refer to this link: http://oraclebizint.wordpress.com/2008/01/17/oracle-bi-101332-pagination-in-pivot-tables/
    Hope this helps.
    Thanks,
    -Amith.

  • How to use JavaScript Zoom in on the layer

    How to use JavaScript Zoom in on the layer

    yeah, i talking about zooming in on a 3D object,do you have a solution

  • How to use Buffering to make image better

    Rigth now I have a DFS maze program, that basically is like a grid maze with three buttons. Randomize (which, duh, randomizes the maze), Solve, and Statistics. When I click on the statistics button, another "wing" opens up on the left showing a text area. But when the text area is being built, what is actually going on in the background processing, is that thousands of maze iterations are running, and then the statistics is printing out. Of course when these iterations are running the maze screen goes blank, and there is one long blink. I would like to make it so that the last maze image stays, until all the statistics in the background is done, and then just the statistics is shown, and not the final maze iteration. So basically the maze image on the right will just be the maze image right before the statistics started running.

    Hi aspirantme,
    >>how to use radioButton(s) and image controls on windows phone 8.1
    Which version of your app is? Runtime or Silverlight?
    For Runtime version, please see the following articles:
    #RadioButton class
    https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.radiobutton(v=win.10).aspx
    #How to add radio buttons (XAML)
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868200.aspx
    #Image class
    https://msdn.microsoft.com/library/windows/apps/br242752.aspx
    For Silverlight version, please refer to the following documents and guidelines:
    #RadioButton Class
    https://msdn.microsoft.com/en-us/library/windows/apps/system.windows.controls.radiobutton(v=vs.105).aspx
    #RadioButton control design guidelines for Windows Phone
    https://msdn.microsoft.com/en-us/library/windows/apps/hh202881(v=vs.105).aspx
    #Image Class
    https://msdn.microsoft.com/en-us/library/windows/apps/system.windows.controls.image(v=vs.105).aspx
    #Quickstart: Images for Windows Phone
    https://msdn.microsoft.com/en-us/library/windows/apps/jj206957(v=vs.105).aspx
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I used to be able to use the tools, edit image and highlight certain items in the pdf photos. why can I not now?

    I used to be able to use the tools, edit image and highlight certain items in the pdf photos. why can I not now?

    Usually Acrobat has linked to PhotoShop to do the photo editing. You might check the updates for Acrobat and PhotoShop.

  • Carousel News App Part - how to use in Enterprise Edition?

    Carousel News App Part - how to use in Enterprise Edition?
    I see it in the 365 but want to add aslo in the enterprise edition
    keren tsur

    Hi Keren,
    According to your description, my understanding is that you want to use Carousel News App Part in SharePoint server 2013 Enterprise edition.
    Per my knowledge, we can use the Carousel News App Part in SharePoint server 2013 Enterprise edition.
    We can download it from Codeplex:
    http://corporatenewsapp.codeplex.com or direct download and install the App from the Office & SharePoint App Store :
    http://office.microsoft.com/en-us/store/corporate-news-app-WA103532495.aspx.
    Is this web part you want?
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • When I use tools to edit, my name is printed in every edit box.  How do I get rid of that?

    I am providing a confidential review of a manuscript, but every time I edit, my name appears in the edit box (insert, strikethrough, etc.).  I need to get rid of that.  How do I do it?

    No, not possible.

  • How to use Javascript, C#, or Java to automatically fill out a PDF file using ACROBAT PRO

    Hi.
    I have purchased a copy of acrobat pro and am currently using it to try to create a method of populating certain fields in a PDF file.
    This particualar scenerio is a printable cerficiate, it has a spot for the persons First Name, Last Name, and other basic info.
    So we have an exisiting editable PDF, a database with the user's info, and a ASP.NET web server, and of course Acrobat Pro.
    How can I use these components to create an auto fill script?
    Ideally, we'd genereate these certs on the fly, and allow users to download them.
    A code sample would be awesome.
    Thanks!
    --shawn

    I've discovered that you can create a "PDF Form" and edit that form with Javascript.
    My question now is, what is the prefered method for controlling the pdf form?
    I would like to include the PDF file in an HTML page and edit the form fields using javascript in that HTML page.
    I think that this is how developers are meant to work with dynamic pdf files.
    In the acrobat javascript reference, it only shows an example using the acrobat javascript console.
    If anyone has used Javascript with PDFs, I would highly appricate some input.
    Thanks,
    -- shawn

Maybe you are looking for

  • IAS patchset 9.0.4.1 is available

    Released 7/23/04. Patchset number is 3784229. --Rick Wright                                                                                                                                                                                               

  • My phone has hardly any in call volume. What can I do?

    Hi there. Can anyone help my phone has hardly any in call volume when turned up full. Is there anything I can do?

  • HT201406 how do i get my ipod off of ipod disabled connect to itunes

    how do i open my ipod if it is disabled

  • S032 has incorrect stock valuation quantity

    Hi All, We are performing an implementation and are loading stock take-on. We have noticed an inconsistency between the LIS and MB52 (material master stock valuation). After some investigations it only happens when we are loading materials using mult

  • ITunes installation problem, like so many others apparently

    I tried to install iTunes but got an error message about ISScript being too old. I reinstalled versions 7, 8, & 9 from the InstallShield website and tried again. Same thing. I then tried the steps listed on http://docs.info.apple.com/article.html?art