Calling javascript from a button

Good morning everyone!
I need to add a message box that asks the user a confirmation to delete information. So I want my delete button to call the javascript necessary to confirm the delete and then delete.
My problem is in calling the javascript. I'm able to do so by using an image for my button and in the image attributes add:
onclick="javascript:confirmDelete('Are you sure you to delete?');"
This works perfectly, except for one thing: I don't want to use an image for the button. It doesn't fit with the rest of the application.
I know it can work, because Oracle is using it on this page:
http://apex.oracle.com/pls/otn/f?p=37719:8:3069181226556730::NO:::
So how can I call my javascript from an ordinary button?

I have a related question:
How can I access the BROWSER_LANGUAGE in javascript? With my method of calling javascript, I didn't find a good way to pass variables to the function that I call.

Similar Messages

  • WAD: Add variable to a called javascript function on button group item

    Hi All,
    I need your expertise regarding the following problem:
    To increase performance, I've decided to hide all analysis tables. To set these tables to visible, there is a button to switch the state for each table.
    Because this function is needed for each table, the function has two parameters for the analysis item name and the new state.
    Unfortunately, I get an useless error message after calling the function.
    The function in script item looks like
    function switchTable(itemName, newState)
    The function is started by a button of a button group item as javascript and the following script function
    switchTable('ANALYSIS_ITEM_1', 'VISIBLE')
    If I enter a without parameters, that will call the function with these parameters, it works.
    But if i try this directly from the script function in the button parameters, the function will be called correctly, but an error occurs and the analysis item wasn't displayed or the sendCommand wasn't processed completely.
    I hope there is a way to call javascripts by a button with variables, otherwise I would have to create many functions with only an other item_ref.
    Many thanks in advance and points of course for any help.
    Regards,
    Tobias

    One short note:
    It's possible to trigger the same function by an html input form button with onlick switchTable('ANALYSIS_ITEM_1', 'VISIBLE')
    and this works.
    Has anyone an idea what's the problem with a normal button item of the button group item?
    Another possibility is a menu item. The functions were called, but errors were shown.

  • Calling Javascript from JApplet

    Does anyone know of a foolproof way of calling Javascript from an Applet on a Web page. I have heard of the JS Object but can't find much aboout it. Does anyone have any ideas?

    or...
    http://turtle.ee.ncku.edu.tw/~zulu/research/seminor02/
    http://turtle.ee.ncku.edu.tw/~zulu/research/
    JRG

  • Call vbscript from Apex button

    I have added a vbscript to the header section of my page and I'm trying to call this from a button. Is this possible? Can anyone post an example of how this would be done. I've tried calling from the URL redirect section, along with many other things and can't get anything to work. I'm not sure if I added in the header wrong or if I'm calling it wrong.
    Thanks

    What about placing outputs from the procedure to fields on the form?
    Here is the procedure I have created:
    procedure vatTotal (Order_no IN number,Total2 OUT number)
    AS
    CURSOR c_vatTotal is
    select order_line.quantity, gre_product.cost from ord, gre_product, order_line where ord.order_no = order_line.order_no AND
    gre_product.prod_no = order_line.Product_no;
    Total number;
    begin
    Total:= 0;
    for c_record in c_vatTotal loop
    Total := Total + c_record.quantity * c_record.cost;
    end loop;
    Total2 := Total;
    end;
    I believe this is correct. It compiles.
    I tried using Total as an out parameter but received the "duplicate fields in RECORD, TABLE or argument list are not permitted" error.

  • Calling javascript from 10g Forms

    Hi,
    RE: How do I call Javascript from Forms 10g (v 10.1.2.0.2)
    Sorry if this post is to the wrong audience but was wondering (as I haven't had an update from the Forms forum) if anyone could tell me how to know
    when a user was navigating away from the current open form because they had entered a new URL in the address bar and were trying to navigate to it?
    The reason for this is that i would want to prompt the user to confirm that they wanted to exit the form as potentially they would have a record (in the form)
    flagged as being updated and as such no other user (including themselves) could susbequently access it.
    So, I'm basically wanting to know if there is a way (by using Javascript?) to catch the fact that the user is about to navigate to another web page.
    Kind regards,
    Tom

    Hi John,
    Well, I'm chasing my tail about this one as not getting any response from any area.
    Apart from the Oracle Forms forum, any other one that you would suggest?
    Kind regards,
    Tom

  • Embedded .swf's calling javascript from air container

    1) I have an html/ajax air app version 1.5.1
    2) This air app embeds .swf files from an external source / web server & plays the embdded .swf inside air.
    3) The embedded .swf file has a button with an onClick event
    function onClick(event:MouseEvent):void {
    ExternalInterface.call("someJavascriptMethod()" );
    4) The javascript method to be called is already parsed inside the containing Air app and is waiting to be triggered.
    5) When the onClick is triggered, the following error is thrown.
    Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX,
    Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.
    at Error$/throwError()
    at flash.external::ExternalInterface$/call()
    at stress_fla::MainTimeline/onClick()
    6) On investigation I found on your livedoc's website that Air does not support the ExternalInterface.call method.
    http://livedocs.adobe.com/labs/air/1/aslr/flash/external/ExternalInterface.html
    Look for Note: Adobe AIR currently does not support the ExternalInterface class.
    7) Does anyone here know how I can get an embbeded .swf file to call javascript methods in the containing air application? I have had a look at the getUrl method but this is now longer supported & even the FS command but still to no avail. I may have a work around by inserting a DOM element over the top of the embedded .swf but this is not an elegant solution & want the .swf to talk directly to the air app container.
    All help & comments welcome
    Thanks
    Kyle
    Additionally I have found
    http://help.adobe.com/en_US/AIR/1.5/devappsflash/WS5b3ccc516d4fbf351e63e3d118666ade46-7ed4 .html
    Using the Html Loader so that Actionscript can call/manipulate the dom objects. At first I was whopee but then I tried the examples listed in the help. The HTMLLoader class is only available in Air. When trying to use import flash.html.HTMLLoader; Flash C4 complains that the Definition cannot be found on compile time & therefore does not export my movie correctly. Has anyone else had this problem or have a solution??
    More additions:
    The reason the htmlLoader class was not compiling was due to the source action script provided being ActionScript 2.0 - the htmlLoader class is a 3.0 library.
    However, after more investigation I have found the current structure.
    The air app has an html base/root doc. On periodic javascript events - .swf files are downloaded via
    videos = new air.Loader();
    netStream     = new air.URLRequest(path + file);
    videos.load(netStream);
    So now I have a html container in my air app that creates a new air.Loader which downloads the external .swf file in which I want an onClick event in the action Script of the downloaded .swf file to call a Javascript method of the parent air container. Simple yea?
    Or am I making life to hard for myself? Have been looking at the security snadboxes but I don't see how I can get the .swf file to talk nicely with the outer air container. Please help if able.
    Thanks
    Kyle

    Hi Kenneth,
    Your explanation makes sense.
    I have a big JavaScript file full of special mathematical functions written by a mathematician who only knows how to program in Javascript.
    I need to call the Javascript functions from within an ActionScript library, which obviously has no UI, and thus HTML and/or HTMLLoader are not an option.
    Any ideas?
    TIA,
    mlavie

  • Calling javascript from procedure

    Hi folks
    I am trying to call in a javascript from an onSubmit procedure after computations and validations. This process is conditional and fires on a button click.
    Heres the procedure body :
    begin
    htp.p('<script language =javascript'>)functiondoSomeThing(1,2);</script>');
    end;
    This is not working. I tried removing the branch from the on click of that button as well but, then it says error no page to branch to. Any possible way in which I can see the effects of the above procedure ?
    I want this javascript to be in procedure only, since this is supposed to act after computations and validations.
    Thanks
    Shantanu

    Hi Shantanu,
    Javascript is client-side code; computations, validations, processes and branches are server-side. In order for the javascript to run, therefore, it has to be on the rendered page - you can not call it after computations and validations without reloading the page with the javascript in it somewhere.
    If the script should only be on the page after the user clicks a specific button, you should set the button to set a value for a hidden item and use this to conditionally display the javascript. I tend to put scripts into a region on their own and use Conditional Display appropriately.
    What should the script do "after computations and validations" that can not be done by a page process?
    Andy

  • "ReferenceError: "myIpAddr"  is not defined, when call JavaScript from java

    Hi developers,
    My java application was trying to issue a http request via proxy auto-config. So, I did below jobs
    1. Read URL of *.pac from registry
    2. Call FindProxyForURL from java, the code is like below
                   ScriptEngineManager factory = new ScriptEngineManager();
                   ScriptEngine engine = factory.getEngineByName("JavaScript");
                   engine.eval(autoProxyScript);
                   Invocable inv = (Invocable) engine;
                   Object obj = inv.invokeFunction("FindProxyForURL",
                             "http://java.sun.com/",
                             "java.sun.com");
    However, I got "ReferenceError: "myIpAddress" is not defined
    I can not change the script on server to add a function like "myIpAddress", I am wordering why IE or mozilla can call it successfully and get proxy server, while Java failed to do that.
    I got a ugly solution by calling "pacparser" by jni. But I really hope I can get a better solution.

    A .pac file is a JavaScript, but it requires some functions to be defined in the executing context to work (i.e. you must define those).
    From the example on the Wikipedia page there's at least "shExpMatch" and "isInNet". "myIpAddress" seems to be another such candidate.

  • Calling report from a button based on parameters

    Hi,
    I want to call a report from a custom button based on some parameters. Suppose
    I have a form based on dept table and I have created a custom button which
    should take the value of the selected deptno and pass as a parameter to the
    report to get all the info from the emp table against that deptno.
    Thanks

    Report:
    You need to create a SQL report with a bind variable. Then you can take a look at the call interface from the "Manage" Screen of your report to find out how to pass parameters to it.
    Form:
    To get the required value from the form, make use of p_session in the Custom PL/SQL handler code, then form the URL of the report and call it using <portal_schema>.wwa_app_module.set_target. Take a look at this post: Problems installing 9iAS 9.0.3

  • Calling Javascript from ABAP webdynpro application

    Hai All,
    I want to call a Javascript from ABAP-Webdynpro application. If anyone has done this. Please let me know.
    Thanks & Regards,
    H.K.Hayath Basha.

    go to window
    create suspend outbound plug and resume inbound type
    when create an outbound plug of Suspend type a parameter Url is automatically created,
    fire the outbuond plug with the Url to a BSP page where you have JavaScript.
    and fromt he BSP navigate back to WDA again which you can do using by reading the url parameter sap-wd-resumeurl, which contains the WDA URL
    Abhi

  • Call Procedure from a Button

    I am trying to call a procedure from a button that will work out the total of an order and display it in the total field in my master block.
    I am unsure as to how to call the prodcedure from my button. I have written the procedure in the PL/SQL Stored Program Units part like it says in the help file but am now stuck.
    I assume I use a WHEN-BUTTON-PRESSED trigger but what do I write in the trigger?

    What about placing outputs from the procedure to fields on the form?
    Here is the procedure I have created:
    procedure vatTotal (Order_no IN number,Total2 OUT number)
    AS
    CURSOR c_vatTotal is
    select order_line.quantity, gre_product.cost from ord, gre_product, order_line where ord.order_no = order_line.order_no AND
    gre_product.prod_no = order_line.Product_no;
    Total number;
    begin
    Total:= 0;
    for c_record in c_vatTotal loop
    Total := Total + c_record.quantity * c_record.cost;
    end loop;
    Total2 := Total;
    end;
    I believe this is correct. It compiles.
    I tried using Total as an out parameter but received the "duplicate fields in RECORD, TABLE or argument list are not permitted" error.

  • How to call javascript from java application

    How can we call a function written in javascript from java application (core java not applet)? How will java identify javascript?
    Is there any such options ?

    Try creating a page called launcher.html (for example). That does this:
    <html>
    <head>
    <script language="javascript">
    windowHandle=window.open("http://www.javasoft.com", "", "height=700,width=1000,status=no,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no,top=5,left=5");
    </script>
    </head>
    </html>Now you launch IE (or whatever) with this page using the Runtime class. After x seconds (after the second window has been launched) try killing the process. Hopefully it will kill the original window you opened and not the window you popup (the one without toolbars etc)
    It might kill both windows but I can't be bothered to test it. If it does you'll have to try and find a workaround.

  • Calling javascript from subdomain

    I have the swf file on the main domain and I call them from a
    subdomain. All works fine except javascript. Does anybody ahve an
    idea why? The same code that I use on a subdomain I use on the main
    domain too, and there javascript calls work.
    Thanks

    or...
    http://turtle.ee.ncku.edu.tw/~zulu/research/seminor02/
    http://turtle.ee.ncku.edu.tw/~zulu/research/
    JRG

  • Calling JavaScript from rangeChangeListener

    Hi,
    I can not call javaScript function from my rangeChangeListener attribute on my table. Is there a way to call JS somehow?
    My situation is following:
    I have table with tableSelectMany. I am condittionaly rendering tableSelectMany checkboxes.
    Sometimes I have no checkboxes in current page (but there is checkboxes in other pages).
    The problem is that Select all and Select none functionalities (that comes automaticaly with tableSelectMany) are not disabled for that kind of pages, so I get error when trying to select when theres nothing in the page to select.
    So I need javascript on rangeChangeListener event to check if I have checkboxes and if not - disable them.
    It looks like ADF bug. Maybe somebody had the same sort of problem or have ideas on how to handle this situation?

    Hi,
    in this case you either go for a terrible JavaScript hack, or get rid of it alltogether
        <afh:head title="DepartmentsTable">
                <style type="text/css">
                    .x2l {display:none;}
                </style>
        </afh:head>Frank

  • Calling Javascript from Flex through FAB

    What's the standard way of calling JavaScript functions from
    Flex through the FA Bridge?
    i.e. is there a new way other than navigateToURL or
    ExternalInterface.call()
    Most of the examples I've seen are scripting Flex from
    JavaScript, not the other way around.
    Thanks.

    Hello,
    You need to register the JavaScript function as a callback to
    a Flex action. You can do this from javascript in a function that
    gets called when the flash movie has finished loading. Then, when
    the Flex event is triggered it will execute the JavaScript
    function.
    Hope this helps,
    Cristian

Maybe you are looking for

  • Performance problems with XMLTABLE and XMLQUERY involving relational data

    Hello- Is anyone out there using XMLTABLE or XMLQUERY with more than a toy set of data? I am running into serious performance problems tyring to do basic things such as: * Combine records in 10 relational tables into a single table of XMLTYPE records

  • How to set up Boot Camp on second drive?

    On Drive bay 2 and 3 I have setup as a RAID which has OSX Installed. I want to install Boot Camp onto the Drive in bay 1. When I run the Boot Camp Assistant, it tells me I can't partition an external drive. What am I doing wrong?

  • Connecting a webcam using airport Express.

    I have a Logitech webcam that I use with ichat. The webcam is working fine when connected directly to the MacBook via usb port. I would like relocating the webcam and use Airport Express to connect it wireless. Is it possible?

  • Urgent: OAM 11g issue

    Hi all, I have installed OHS 11g & webgate 11g in one machine and OAM 11g in another machine. While starting the OHS i am getting the following error in ohs1.log file. [2012-12-04T14:41:42.3674+05:30] [OHS] [ERROR:32] [OHS-9999] [apache2entry_web_g a

  • Append Today Date to the Attachement Name using SQL reporting services

    I have a report on SQL reporting services, I have scheduled this report to be sent automatically by mail using Subscriptions but the client needs to append today date to the report name attached, currently the attachment is taking the report name as