Executing Javascript with button

How can I go about executing javascript with an item level button?
In the HTML DB 2 day tutorial it says this:
Calling a JavaScript from a button is a great way to confirm a request. Oracle HTML
DB actually uses this technique for the delete operation of most objects. For example,
when you delete a button, a JavaScript Alert Box appears asking you to confirm your
request. Consider the following example:
<script language="JavaScript1.1" type="text/javascript">
function deleteConfirm(msg)
var confDel = msg;
if(confDel ==null)
confDel= confirm("Would you like to perform this delete action?");
else
confDel= confirm(msg);
if (confDel== true)
doSubmit('Delete');
</script>
This example creates a function to confirm a delete action and then calls that function
from a button. Note that the function optionally submits the page and sets the value of
the internal variable :REQUEST to "Delete," thus performing the delete using a process
that conditionally executes based on the value of request.
Note that when you create the button you would need to select the Action Redirect to
URL without submitting page . Then, you would specify a URL target such as the
following:
javascript:confirmDelete('Would you like to perform this delete action?');
Can I only do this from a region button?

hi,
I have created a javascript form validation and finally (if its passes the validation) I am setting the :REQUEST as doSubmit('GO');
I am calling a conditional process with condition as request = expression1
with expression 1 as GO.
The javascript is as follows
function message_name_not_null(){
if(document.getElementById('P14_MESSAGE_NAME').value.length==0)
alert("Message Name is Mandatory!!");
return;
else if(document.getElementById('P14_MESSAGE_TEXT').value.length==0)
alert("Message Text is Mandatory!!");
return;
else
doSubmit('GO');
My problem is my process is not getting called in button click(I have called the javascript from this button as javascript:message_name_not_null(); in Optional URL Redirect section)
I have specified the :REQUEST value in the branches also.
Any sort of help please..
Thanks in Advance
Kaushik

Similar Messages

  • Execute javascript with input parameters of a taskflow

    Using JDev 11g PS4
    I have a taskflow that uses some javascript. When the taskflow has been loaded, I need to execute a javascript function that uses 2 input parameters of my taskflow.
    I don't really know how I can execute the javascript with my input parameters.
    As a test, I have added a commandButton in my taskflow that will do the job:
    <af:commandButton id="btnRefresh" text="Open">
                <af:clientAttribute name="long" value="#{pageFlowScope.pLong}"/>
                <af:clientAttribute name="lat" value="#{pageFlowScope.pLat}"/>
                <af:clientListener method="doNavigate" type="click"/>
            </af:commandButton>How do I do the same when the taskflow loads instead of needing to push the button.

    Please find attached sample based on your use-case:
    http://adfsampleapplications.googlecode.com/svn/trunk/JavascriptOnLoadSample.rar
    It invokes a javascript function on pagefragment load by passing the input parameters from the taskflow.
    Thanks,
    Navaneeth

  • Execute JavaScript and Button

    Hello Forum,
    I have a project anomaly. I have created about ten captivate
    projects, all using a similar (almost identical) menu system.
    This is basically an ending slide with three buttons on it.
    One button has an Execute Javascript action tied to it. my code
    there is a function to open a separate browser window when the
    button is clicked. I wrote the function to open the window in the
    "standard.js" file that Captivate publishes. I am using Captivate
    3. In 8 of these projects, when the button is clicked it opens the
    browser window.
    In two of thses projects the button makes a nice click sound,
    I see a quick screen/window flash, but no new browser window!
    Same button same code same standard.js file.??? I checked a
    button that works, and compared its properties to one that does not
    work, they all have the same numbers, etc. I gave up.
    Then I copied a button that works from an app that works, and
    copied that button on to the project where the button did not open
    the window. Deleted the "bad" button, revised the link address in
    my call to the function: wopen("
    http://info.mysite.com"); and
    this works!
    I have been using the standard Text button for these apps.
    Any ideas on this one??? the publishing for the programs is
    all the same (Flash Player 9, etc)
    Thanks,
    eholz1

    @Erickj:  Either do what Rod stated (adjusting your Flash Security settings) or test your content from a true web server.  Flash automatically trusts content coming off a true web server where the web address begins with http or https and ends in .htm or .html. 
    The nice thing about Cp 7 is that it has a built-in web server so you don't run into issues like this when testing your content.

  • Execute javascript from plsql in a dynamic action.

    Is it possible to execute javascript with htp.p from a plsql block in a dynamic action (on change).
    I have tried it but I get a JSON error.
    The reason I want to to this is:
    I have to check something with plsql and depending on the result I want to do something in javascript.
    I now going to try it with ajax from javascript, but if somebody has a other way to do this i like to hear it.
    Thanks,
    Fred.

    Very neat, many thanks.
    I now have a 'Set Value' 'Javascript Expression' action of 'this.triggeringElement.id;' to set a hidden *but unprotected* page item. This is followed by the 'Execute PL/SQL' action which simply calls a package procedure and passes the name of the triggering item. The procedure then sets the session state(s) as required.
    Thank you!

  • Issues with Executing Javascript command in Captivate

    Hi,
    I am having issues with executing javascript for a button in adobe captivate 5.  Let me explain what I am trying to do.  I am working on a WBT that has three skill checks throught the course. These skill checks are not graded or tracked for completion.  I currently have an image button that has the command "Open another project" The first image button is pointed to SkillCheck1 and I have the html file and swf file in the published root folder.  This currently works fine.
    However I want to use javascript to open a new window 800X600 with not toolbars at the top.  I got this part working with the code below:
    window.open('http://www.adobe.com','mywin',
    'left=40,top=40,width=800,height=600,toolbar=1,resizable=0');
    My only problem is, once the popup opens, my WBT goes to a page that says [object] and thats it.  I am uploading two images to show what I have.  Can someone help resolve my issue of the WBT going to

    Ok so I took this link and viewed over it.  I am new to Javascript and know very little about it.  Therefore this script kind of makes no sense to me.
    <script language="JavaScript"><!--
    var windowHandle = '';
    function myOpen(url,name,attributes) {
        windowHandle = window.open(url,name,attributes);
    //--></script>
    <a href="javascript:myOpen('page.htm','windowName','height=100,width=100')">text link</a>
    I chose the option to exectute javascript.  Does captivate need all of this including <script language=JavaScript">  Here is how I edited the script.  Should I make any changes to what is in bold?
    var windowHandle = ''; 
    function myOpen(url,name,attributes) {
        windowHandle = window.open(url,name,attributes);
    <a href="javascript:myOpen('http://www.adobe.com','Adobe Website','height=600,width=800')">text link</a>

  • Use Javascript with InDesign buttons?

    I haven't been able to find ANY info about this anywhere, but I'm wondering if it's possible to call a Javascript function from an InDesign button, instead of link to a web address. This can obviously be done in Flash, but the same syntax that works in Flash does not work in InDesign. I'm not referring to the Scripts panel here - I'm talking about using Javascript with a button created in InDesign. I tried calling a JS function with the GetURL action, to no avail.
    If anybody has ever done this, please post a sample of the correct syntax for a JS function call, as well as which action I should use. Many thanks in advance!

    (Edit: I'm talking about ID CS4/CS5 SWF export, naturally)
    I don't know why, but the following URL (using a global javascript function) seems to work, somehow;
    javascript:alert('testing');
    Arbitrary function names do not work - browser just says "function not defined" - although the same stuff works in Flash. For example;
    javascript:myFunction();
    Also, there seems to be very little info on which (button) properties are included in the SWF export.
    Additional information on the subject would be much appreciated here, too.

  • Using Adobe Acrobat - Is it possible to execute JavaScript to report to LMS to track pdf was viewed?

    Question:  Using Adobe Acrobat - Is it possible to execute JavaScript to report to LMS to track pdf was viewed?
    What I would like to do is to create a pdf with an Acknowledgement button that when click will report (via JavaScript) to the LMS (Learning Management System) that the end user viewed/acknowledged the pdf.
    Can this be down with JavaScript in this fashion?

    Thanks, (My fault, as I should have specified this.) Due to legacy reasons I need to use ie, and so I can't use the PrintPdf firefox plugin. So from reading the rest of that thread, the best method does seem to be to get hold of a copy of acrobat, and add a Print() script in each file, and open it in a new tab.
    At least it gives me somethigin to try anyway :-)

  • Execute Javascript after *.jspx page rendered

    I have a page with controls and a subform with a servlet, rendering a jasper report:
                   <af:panelFormLayout id="pfl1" partialTriggers="cbReportHTML">
                    <af:subform id="sfRep">
                      <jsp:include page="/jasperservlet" flush="true"/>
                    </af:subform>
                  </af:panelFormLayout>
    I want the page to be rendered before the subform (so that user can see controls on page before the report).
    "/jasperservlet" generates the report in about half a minute.
    I want to have a JavaScript that runs after the page is rendered (and the user sees the controls) and then it starts to generate report.
    I tried to put a frame with such javascript, but the javascript is executed before user can see controls.
    How can it be done?

    Thank you for your answers.
    Yes, I'm trying to execute javascript code on the child page, the modal one.
    Basically, there's a button on my parent page which opens the modal page. The modal page has buttons Cancel, Delete and Save. Clicking Save button submits the changes and if there are errors, errors are shown and we stay on the modal page.
    My modal pages are all of fixed dimensions and if there are errors, I have to adjust the other regions (adjust their height, add a scrollbar, etc) in order to show everything in the modal page.
    I have written a function that does exactly that, but I have to execute the function after the page is loaded and the regions are shown. But, if I execute it using onload attribute, or setting a dynamic action which fires on page load, the function gets executed during the submit, before the regions are shown.
    I hope I have managed to clear up the problem.
    As always, thank you.

  • Captivate 3 Published file won't execute JavaScript

    Pulbished Captivate 3 course.   Final screen has an exit button with the following script:  ab_SetScoreStatus(100,'completed');ab_CloseWindow();       When I post the course to our LMS it uploads fine, but when I try and run the course I get an error when I click on the Exit button and it doesn't do anything.   I had someone try the same thing on their computer and it works fine for them so I'm thinking it's something with my settings.   This used to work for me but then I got a new computer so not sure if the settings (IE, Flash or ????) are different or what.   I'm running Flash 10, and IE 8.   Any help would be greatly appreciated.  Thank you.

    Good morning Rick, and thank you for trying to help.
    Sheri Delaney
    From: Captiv8r [email protected]
    Sent: Wednesday, February 16, 2011 3:59 PM
    To: Delaney, Sheri
    Subject: Captivate 3 Published file won't execute JavaScript
    Welcome to our community
    See if the following links help.
    http://forums.adobe.com/thread/473021#5
    http://forums.adobe.com/thread/473021#10
    Cheers... Rick
    http://www.robowizard.com/pc.gif
    Helpful and Handy Links
    http://www.Adobe.com/cfusion/mmform/index.cfm?name=wishform&product=5
    http://www.ShowMeSolutions.biz
    http://sorcererstone.wordpress.com/
    http://www.gooberguides.com

  • Execute Javascript, window.print(), prints blank page in Captivate 7

    Hello,
    I'm fairly new to Captivate, and am no Javascript expert.  I've been trying to figure out how to print the last slide in project, which has a custom certificate.  I initially tried the print widget that comes with Captivate 7, but the scaling is off when printed.  There are no options to change the scale of the printed slide on the widget properties, so that seemed to be a bust.  I then tried to create a button to execute javascript when clicked.  In the script window I put, window.print(); now this works to bring up the print box, but only prints a blank page.  I'm not sure if it's something I'm doing wrong with javascript.  I've been reading other forum posts, and this function seems to work for others using different versions of Captivate.
    I know there is a cool print widget that someone has made, but I'd actually prefer to just do this with javascript.  I haven't tried the buyable print widget yet, but I am trying not to use widgets so that the html can be scalable. 
    I'm publishing my projects and uploading them to GoogleDrive, where I then preview the html output.
    I'd appreciate any help.  Thanks!
    Kailey

    Wow, thank you for such a speedy response Rick.  I've actually been using Firefox and Google Chrome, because IE isn't updated enough to work with Google Drive properly (and I don't want to go through the whole process to get privileges to update on work computer).  But I did check this box in Firefox.  Instead of printing the objects on my slide, it printed a big square light grey background.  It's almost like the the browser can't see the project.
    I would think this was a browser problem, but I had previously downloaded a trial of Articulate (trying to decide between the two), which has the same execute javascript function as Captivate.  Putting in window.print();, publishing, and uploading to Google Drive, printed just fine.  Not sure if something in the code in Captivate isn't coming through, but is in Articulate.  I'm not versed in html or javascript enough to compare the two html files. 
    Back to the drawing board!  Thanks for your help.
    Kailey

  • Javascript print button problem in C4

    Hi Everyone,
    I'm currently using Captivate 4 and would like to allow users
    of my tutorial to print off slides. I created a button which
    executes javascript to do this. The problem is not that this
    doesn't work at all, it's just that it isn't working when I publish
    to Flash player versions higher than 7. Any ideas you might be able
    to share with me on how to fix this will be very welcome.
    Many thanks.

    I suspect that the problem has to do with the added security
    included in Flash 8 and above that restricts javascript. If you
    search the flash player KnowledgeBase on Adobe.com you'll find more
    detailed information about fixes, but here is what worked for my
    Javascripted items.
    Find your Program Files > Adobe > Adobe Captivate 4
    > Templates > Publish folder. Within the folder is a
    standard.htm file. Open this file (for this simple task, i just use
    notepad). In the script section, add...
    so.addParam("allowScriptAccess", "always");
    you'll see other similar param declarations. It doesn't
    matter the order.
    You can edit the individual .htm file if you want to test
    this first.
    That should do it.
    Here is the KB article that discusses the security features
    in greater detail:
    http://www.adobe.com/devnet/flashplayer/articles/secure_swf_apps_04.html

  • Javascript Submit button onclick event handler

    Hi,
    I am having trouble getting the onclick event handler of a form to execute when the button is pressed. I am trying to open a page in a new window depending on if the user selects that option in a checkbox.
    There is one form(id='graphform') and 2 submit buttons, each with a checkbox before it. I want the new window to open only iuf the right checkbox and matching submit button has been checked.
    One of the checkbox/button pair: The onclick="checkWindow('w1','graphform');" is never getting called.
    <input type="checkbox" id="w1" name="win1" style="margin-right: 10px" value="window"  onclick="javascript:document.gform.win1[0].checked = true;"><a style="margin-right: 10px">Graph in new window</a>
    <input type="submit" value="Create graph" onmouseover="this.form.cumulat.value='0';this.form.graphGroup.value='Consumption'; document.getElementById('hintSubmitStop').value='1';" onclick="checkWindow('w1','graphform');" onmouseout="document.getElementById('hintSubmitStop').value='0';" /></td></tr>Javascript window opener:
    function checkWindow(win1, str){
              var formObj = document.getElementById(str);
         var checkBoxObj = document.getElementById(win1);
         if(checkBoxObj1.checked == true){
                   formObj.target = "_blank";     
                   formObj.action = "graphDisplayFrame.jsp";     
         else if(checkBoxObj1.checked == false){
                   formObj.target = "_self";
                   formObj.action = "graphDisplay.jsp";
    }Any suggestions?
    J

    You're storing the value in "checkBoxObj" and in the next line you use different variable name as "checkBoxObj1".
         var checkBoxObj = document.getElementById(win1);
         if(checkBoxObj1.checked == true){
    instead of "true', try      if(checkBoxObj.checked == 1){

  • Javascript on button item

    Hi, created a very simple (two column) report based on pl/sql. Under edit page, html header added a javascript function that will opens the my report on a new popup window. NOW, I created a button on my page with style of HTML Button. By pressing this button I like to call that javascript to open my report. But each time I press this button it acts as submit button. If I create an url it works but I like to do this with button. Where can I palce my call to javascript?
    thanks for your help
    -iahmadi

    Hi:
    It appears that you have created a button that is 'displayed among this region's items'. AFAIK ,this kind of button , when clicked, submits the page unconditionally. Drop this button and create the button as a 'region button' (Create a button in a region position).
    Varad

  • Using "Execute Javascript" to mark a course as Complete. 

    I am using a 3rd party Flash-based player (Flashform) to
    bundle Captivate and Flash made SWF files into a SCORM 1.2 package.
    My final SWF is a Captivate assessment, which, if passed, should
    change the course lesson status to “completed”. Can I
    accomplish this by using “Execute Javascript” on a
    button and run something like:
    “FSCommand("LMSSetValue","cmi.core.lesson_status,completed");”
    Any advice is greatly appreciated.
    Jon

    If you were using only the Captivate-published files for
    SCORM, it would likely be fairly straightforward to do what you're
    looking for.
    Unfortunately, since you're using a 3rd-party player, you'll
    have to consult the documentation for the player to determine which
    capabilities it exposes and how you can access those capabilities.

  • Javascript with PL/Sql

    Hi everyone,
    I want to know if it's a good idea to use javascript with PL/sql using HTML-DB (PL) (enabled and disabled button) ?
    Thank you very much. Bye.
    Eric

    I would suggest you pay attention to the base directory where the relative paths for @src and @href make pertinent value pointing to the desired resource.

Maybe you are looking for

  • Print Module: Auto-Rotate to fit and Photo Info Text

    When in the print module with "Auto-Rotate to fit" selected, A landscape images correctly rotates to fit the page, but the text that is selected in the "Photo Info" setting does not rotate. Thus, the text appears along the left side of the image . An

  • What is the Full Charge Capacity showing for your 11.6 MBA

    Mine started out at around 4675 and is now at 4539 with 16 Cycles. I'd like to see if I'm in the ballpark and if not, what the users with higher capacity are doing: charging, conditioning, etc.

  • Optimizer error

    Dear Sir,   When i executing the t-code DSWP some error is  coming (profile parameter icm/host_name_full is not set correctly see long test) Can u please tell me how to solve this issue. REgards, K.Ramamoorthy

  • NO RISK

    i am creating a Risk and trying to do risk analysis(RA) at Role(or User level). I have created 2 functions with 1 tcode each.on backend i have created 3 roles, where 2 of the roles contain 1 (different)tcode each, and the 3rd role contains both the t

  • Oracle Project Portfolio Management

    Hi, Does Oracle have Project Portfolio product within EBS ? If Yes, as we already have Oracle Projects implemented, so do we need to go for different License ? Appreciate your feedback. Regards, Khan.