Javascript on Delete

Hi,
I created a button that runs a procedure (delete data)
I attached javascript code to the button.
javascript:confirmDelete('Are you sure you want to delete data?');
I added the java script to HTML Header on the page
<script language="JavaScript" type="text/javascript">
<!--
htmldb_delete_message='"DELETE_CONFIRM_MSG"';
//-->
when I click on the 'Delete' button,the message pops up.
But when I click OK the procedure doesn't run.
The procedure works fine without the java script.
Any help is greatly appreciated.
Thanks in advance.
Haritha

Hi,
If any one is having the same issue,here is the solution.
I used this function for the javascript in the page HTML Header
function confirmDelete(msg)
var confDel = msg;
if(confDel ==null){
confDel= confirm("Are you sure you want to delete the data ?");}
else{
confDel= confirm(msg);}
if (confDel== true){
doSubmit('Delete');}
Then on the process selected a condition type
Request = Expression 1
and Expression 1 is 'Delete'
and in the button I called the java script as
javascript:confirmDelete('Are you sure you want to delete the data?');
Thanks,
Haritha
Message was edited by:
hparla
Message was edited by:
hparla

Similar Messages

  • Javascript to delete clipping mask

    Hi all,
    I have an Applescript that places a PDF into a document. When the file is placed, it's cropbox becomes a clipping mask, which I then need to delete.
    So I have the following:
    set themasterlayername to "Legend"
    tell application "Adobe Illustrator"
    tell current document
    set clipList to every path item whose clipping is true
    repeat with clipItem in clipList
    set sel to name of (layer of clipItem)
    if sel is themasterlayername then
    delete clipItem
    end if
    end repeat
    end tell
    end tell
    This seems to be the only way I can find path items that are clipping, by testing in a repeat loop whether they belong to the layer I have placed the PDF into.
    However, when there are a lot of objects (say from a CAD file) on other layers, the script runs very slowly, as it has to test every object to see if 'clipping' is true
    Would this be quicker in Javascript? Delete all clipping path items on a certain layer. Or is there another way to narrow down getting only items belonging to the specific layer? For some reason if I put in 'of layer themasterlayername', I get no objects.
    Thanks for any help
    Ian

    This is NOT tested but could not…
    tell application "Adobe Illustrator"
    tell current document
    delete (every path item of layer "Legend" whose clipping is true)
    end tell
    end tell
    The 'whose filtering' and target layer should deal with the lot?

  • Javascript for deletion of records

    hi all
    i have a table on which a function acts to insert and delete records. I have to check whether the table has existing records for a particular month before deletion and if it does then a javascript popup should say that "records already exist if you continue all records will be deleted. do you wish to continue?"
    how can i do that? how can i check whether records are already existing using javascript?
    sam

    Samd,
    Why not put a computation in the Page Rendering phase which will determine whether or not any records exist. Then, you can use a simple JavaScript confirm() to determine whether or not to submit the page, and thus delete the records.
    An example of this can be found here: http://apex.oracle.com/pls/otn/f?p=28534:1
    The source for the JavaScript is as follows:
    function deleteRows()
    if (document.getElementById('P1_NUMBER_OF_ROWS').value == 0)
      {doSubmit('DELETE');}
    else
      {alert('There are child records and this delete operation cannot proceed.');}
    }There is also a computation for P1_NUMBER_OF_ROWS which will return the number of rows for a specific table/view. If it returns 0, then the process mapped to the "DELETE" button will fire; otherwise, the JavaScript will display an alert with the appropriate message.
    One note - always enforce this type of logic at the data model level. Should the JavaScript fail or not fire correctly, you need to ensure that the referential integrity of your data remains in tact.
    Thanks,
    - Scott -

  • JavaScript function deletes previously entered data

    Hello, I am using Adobe LiveCycle Designer version 9.0 and have created a one page form with a radio button list which allows a user to create an additional duplicate page when selected. All of the form was created as a master mage with the exception of the additional page radio button list that exists on &quot;Page1.&quot; The script works great except all data entered by the user on Page1 is deleted when the additional page is created. Any suggestions would be greatly appreciated. I know just enough about JavaScript and FormCalc to paint myself into a corner (obviously) so speak slow and use small words please ...
    Here is the code to add additional page:
    topmostSubform.Page1.RadioButtonList::click - (JavaScript, client)
    if (RadioButtonList.rawValue==&quot;1&quot;)
    {Page2.presence = &quot;visible&quot;;}
    else if (RadioButtonList.rawValue ==&quot;2&quot;)
    {Page2.presence = &quot;hidden&quot;;}
    else
    {Page2.presence = &quot;hidden&quot;;}

    I see two things that are problematic:
    In general, you should try to avoid putting fields on a master page...you can sometimes experience unexpected results when you do.  Move your table to the body page instead and your problem will go away.
    All of your fields are set with binding of "No data binding" (Object-->Binding-->Data Binding).  As a result, if you save your form, close and re-open it, the data will likely be lost.  At a minimum you should set the data binding to "Use Name".
    Some other recommendations:
    Try to avoid using so many rectangles...they are unneccessary, and the the number of objects used on your form can impact performance.  Use borders around text fields or text objects instead.
    You should have a single table rather than two separate tables on two separate pages.  If you add a second page, then the totals at the bottom of each page will only reflect the totals for that page.  Create a dynamic table and allow people to add new rows rather than adding an entire page.  The use of a flowed layout and a content area on the master page will prevent the data from flowing into the footer and will force the creation of a new page as needed.
    You have a bunch of scripts on your dropdowns that try to connect to a database connection that doesn't appear to exist.  Remove these if they aren't needed.
    Because the Approving Official field is on the master page, it will appear at the bottom of every page.  Do you want it at the bottom of every page, or just at the bottom of the last page?  If the bottom of the last page, then add it to the body page in a flowed layout, or create two separate master pages.
    Week Ending appears at the top of every page, but you have to enter a value on every page.  Set the data binding to "Use global data" and it will ensure that the values on each page are kept in synch.

  • Deleting a row from a table using javascript.......

    Hi,
    i am writting an application in which, i need the following:
    1. calling a javascript on a click of a button named "Delete"
    2. and javascript should delete that particular record under which the delete
    button is placed which means... i am placing a delete button and a checkbox
    under every record i display on my browser. When the check box is checked ,
    and when the user clicks Delete button, it should delete that particular record.
    Any one can help me in this please.....
    Thanks in Advance....
    Bala

    <p>The short answer: You can't. At least not the way you're asking to.</p>
    <p>
    JavaScript does not (to my knowledge at least, someone please correct me if I'm wrong) have any way of connecting to an Oracle database to query for content, though it is possible with DHTML to substitute content into the page.
    </p><p>
    To do what you want, you're going to have to look into server-side scripting languages. Among the more notable examples are PHP, Perl, JSP, and ASP. I would recommend PHP, especially with the PHP right here at Oracle.com.
    </p><p>
    Anyways, what you're probably going to want to do is have a unique identifier for each row which you would be passing to the server and mark each delete button with that identifier. If you want the operation to be extremely transparent, you would use a HTTP-POST-style form parameter passing as opposed to HTTP-GET (which would expose all arguments on the command line, plus or minus any encryption you attempt to discourage script kiddies from probing the quality of your code).
    </p><p>
    But the important point here: There is no way to not send a request to the web server and still do what you want to do.
    </p><p>
    Hope that helps.
    </p><p>
    Cheers.
    </p>

  • CP5: Problems with Execute Javascript and New/Current window setting

    Hello everyone,
    I am at my wits' end trying to set this up properly, and I was hoping for some help.
    I have inserted a series of buttons designed to open other captivate-created HTM files. I wanted the files to be opened in a controlled window, so I used Execute_Javascript function on the buttons. Here is the code I am using:
    void window.open('filename.htm','name','height=680,width=906,left=0,top=0');
    I enter that code in the script window. I also want to set it to open in a new window (not reuse the current window), so I used the arrow to the right of the Script_Window button and set it to "New."
    When I publish and put it all up on a SharePoint server, it works fine. But then I had to correct a typo on one of my slides (unrelated to this functionality), so I corrected it and republished. The buttons which were working moments before now no longer function. It seems that the "New" setting I had set in the drop-down had reverted to "Current" without me touching it. The Javascript also stopped working. Clicking the button sometimes launches the file in the current window, sometimes in a new window, and sometimes the launch itself fails.
    Captivate just seems to forget the New/Current setting all by itself. And for some reason, the actual launching of the file via Javascript also just stops working.
    As a test to fix the non-functioning Javascript, I deleted the word "void" then saved the CPTX. Then I added the word "void" back in, saved it again, and published, and now it works. I can't make heads or tails of this, and it is very frustrating, especially since it will delay the delivery of my files.The javascript reads the exact same and yet sometimes it works and sometimes it doesn't.
    Has anybody seen this before? How on earth do I fix it?
    Thanks!

    Hi Jim,
    Thanks for the feedback. It's good to know that the New/Current issue is a bug and it's not just me.
    I tried your suggestion, and I am still having the same problem. I also tried switching to Open File or URL and entering this:
    javascript:void window.open('filename.htm','name','height=680,width=906,left=0,top=0' );
    Same problem. Sometimes it works and sometimes it doesn't. Code is exactly the same. I can literally put the code in and publish, it works fine, then I can go back into the project, change something completely unrelated (i.e., not touch the javascript), publish again, and now it doesn't work.
    Thanks for any additional feedback.

  • Delete bookmark in batch file

    Hello,
    I am trying to create a batch file which will delete a certain bookmark name "References". How do I automate this? I have few other items that the batch is already doing that have already been configured. I'm thinking I need some JavaScript to delete the bookmark, but I have no idea where to start.
    I have Adobe Acrobat 9 Pro.
    Thanks.

    In that case you can use this code to do it:
    if (this.bookmarkRoot.children!=null) {
        for (var i=0; i<this.bookmarkRoot.children.length; i++) {
            if (this.bookmarkRoot.children[i].name=="References") {
                this.bookmarkRoot.children[i].remove();
                break;

  • Javascript onclick  from Java

    Hello,
    My Google-fu seems to be weak today... I'm writing a simple HTTP parser. It downloads a specific page, parses out the links to the files I'm interested in, then downloads those links. Long story short, certain files on the remote sites are getting corrupted, and it would be nice if my program could handle the cleanup of those files while it is doing the data collection.
    The web interface has the following javascript function:
    <SCRIPT LANGUAGE="JavaScript">
                      function Delete(What)
                        if (window.confirm("Do you really want to delete this file"))
                          location.href = What;
    </SCRIPT>And each file listing has the following HTML:
    <IMG SRC="/Images/Trash.gif" OnClick="Delete('/StorageCard2/TEMP21.csv?DELETE')" />Is there some way to call this delete function from within my java program?
    I've been trying something like this:
    URL url = new URL("http://xx.xx.xx.xx/StorageCard2");
    URLConnection uc = url.openConnection();
    uc.setDoOutput(true);
    OutputStreamWriter writer = new OutputStreamWriter(uc.getOutputStream());
    writer.write("Delete('/StorageCard2/TEMP21.csv?DELETE')");
    writer.flush();I'm probably way off base here, but I can't seem to figure out how to form the correct output, or whether this is even possible. Every combination of URLs I try to submit in the web interface leads to errors. There must be some simple way to simulate clicking those links, or just call the delete command directly.
    Can anyone enlighten me as to what I need to do, or where I need to start looking?

    And I have to say I'm ultra confused as to why you thought that this would do something good.
    URL url = new URL("http://xx.xx.xx.xx/StorageCard2");
    URLConnection uc = url.openConnection();
    uc.setDoOutput(true);
    OutputStreamWriter writer = new OutputStreamWriter(uc.getOutputStream());
    writer.write("Delete('/StorageCard2/TEMP21.csv?DELETE')");
    writer.flush();

  • Applying javascript between process

    Hi all,
    I have created a button by selecting position "Create a Button Displayed among this region's items" and named it as "Send Email".
    I have created an on submit process which binds to this button.How can i first ask a javascript confirmation message from user and then run this process as per the response(Y or N).Can someone help me in this regards.
    Regards,
    Neha

    hi,
    try this
    in button url target
    javascript:doMySubmit('DELETE');
    in page header
    function doMySubmit(act)
    if(act == "DELETE") confirmDelete(htmldb_delete_message,'DELETE');
    <script language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    //-->
    </script>
    Note: change according to your need
    Thanks
    Mark Wyatt
    Edited by: Websoft on Sep 24, 2009 3:01 AM
    Edited by: Websoft on Sep 24, 2009 3:02 AM

  • Javascript open method

    I have an Apex 2.0 application where I have a report with a column that contains an icon with an href tag that calls a javascript method. The function provided below is supposed to take in that variable and utilize the open method to "reload" the page. The expectation is that by reloading the page and passing in the item value via the URL definition that I would then be able to issue a doSubmit() call that would execute a DELETE process.
    Unfortunately, what I am finding is that the open method is never actually called when a doSubmit method is to be subsequently executed. This is confirmed by the fact that the deletion never occurs and that the value of :P50_RECORD_ID is not set. However, if I remove the duSubmit() method from the code then the open method works perfectly and assigns the value of :P50_RECORD_ID to the value of id.
    Any ideas on how I can get this process flow to work?
    <script language="JavaScript" type="text/javascript">
    function Delete(id)
    var url;
    url = 'f?p=&APP_ID.:50:&APP_SESSION.::::P50_RECORD_ID:' +
    id;
    open(url, "_self");
    if (confirm("Delete this submitted recommendation?"))
    doSubmit('Delete');
    </script>
    If anyone would like more clarification please let me know! Thanks in advance!
    -Rudy Wilkinson

    Hi Rudy,
    A few questions:
    1 - have you tried using document.URL = url; instead of open()
    2 - Once the new url has been loaded, surely the remaining javascript doesn't run anyway?
    3 - Are you trying to get the user to confirm deletion of a record and use the url to perform the deletion? If so, shouldn't the confirm() function be first?
    4 - You say "DELETE" process, but are calling doSubmit('Delete') - should this be doSubmit('DELETE')?
    Andy

  • Script for jsp

    <script type="text/javascript">
    function functiontest(process,empname)
    alert(process);
    alert(empname);
    document.empdetform.processName.value=process;
    document.empdetform.empname.value=empname;
    document.empdetform.submit();
    </script>
    <c:forEach var="empData" items="${empAllData}">
         <tr>
                        <td width="15%"><c:out value="${empData.empname}"/></td>
                        <td width="12%"><c:out value="${empData.empid}"/></td>
                        <td width="12%"><c:out value="${empData.username}"/></td>
                        <td width="12%"><c:out value="${empData.password}"/></td>
                        <td width="21%"><c:out value="${empData.dob}"/></td>
                        <td width="12%"><c:out value="${empData.email}"/></td>
                        <td width="11%"><c:out value="${empData.age}"/></td>
                        <td width="12%"><c:out value="${empData.sex}"/></td>
                        <td width="12%"><c:out value="${empData.city}"/></td>
                        <td width="12%"><a href="# onClick=javascript:functiontest('EDIT','<c:out value="${empData.empname"/>');><b><font color="#800080">Edit</font></b></a></td>
                        <td width="12%"><a href="#" onClick=javascript:functiontest('Delete','<c:out value="${empData.empname}"/>');><b><font color="#800080">Delete</font></b></a></td>
         </tr>
    </c:forEach>
         <input type="hidden" name="processName"/>
    i have wirte the script to pass the value in hiddenfields,the value is not passed to the servlet and the request action is not processed for the servlet.Can anyone correct the right script.(I am getting the alert of both values)

    STM12 wrote:
    i have wirte the script to pass the value in hiddenfields,the value is not passed to the servlet and the request action is not processed for the servlet.Can anyone correct the right script.(I am getting the alert of both values)What do you mean by " the request action is not processed for the servlet"?
    Do you mean that the servlet is not being called at all?

  • Flash SWF file help

    I've uploaded my page and all associated files (swf, images),
    but the swf won't play in my browser.
    Please visit -
    http://www.tbproductions.com/s&f/clients.htm
    There is supposed to be a swf Menu under the header and a swf
    in the body of clients.htm.
    I don't understand what I am doing wrong. Thank You
    !!!

    I took a good look at the code and noticed this script was
    looking for my local folder on my C: drive
    <script src="C:sites/Scripts/AC_RunActiveContent.js"
    type="text/javascript"></script>
    instead of
    <script src="Scripts/AC_RunActiveContent.js"
    type="text/javascript"></script>
    deleted the C:sites - and it works fine !
    thanks for your help!

  • Multi insert on table with checkbox list

    Hi all,
    I've a problem perhaps it's a small one but I need to do an insert on a table with with the use of a checkbox, however the checkbox retrieves multiple values.
    Which I've tried to insert with a loop in the pl/sql block.
    How exactly can I do that using bind variables ? Can I get an example, please?
    using Apex 4.0
    kind regards,
    Cleo

    Hi,
    what are you trying to do ? Are you inserting a line only a checkbox is checked, or are your trying to save the values of a group of checkboxes ?
    I got an example for deleting a line with a checked checkbox :
    In your process
    DECLARE
       va_val APEX_APPLICATION_GLOBAL.vc_arr2;
    BEGIN
      va_val := APEX_UTIL.string_to_table(:P20_PARAMETRES, ',');
    FOR i IN 1..va_val.count LOOP
        DELETE MY_TABLE WHERE ID = va_val(i);
    END LOOP;
    :P20_PARAMETRES := '';
    END;In your page header (javascript)
    function delete(){
       if(confirm('Do you really want to delete the checked options ?')){
       var param = document.getElementById('P20_PARAMETRES');
       var root = 'f20_';
       var i = 1;
       var id;
       do{
         id = root + i;
         obj = document.getElementById(id);
         if((obj != undefined) && (obj != null)){
            if(obj.checked == true){
               if (param.value == ''){
                 param.value = obj.value;
               } else {
                 param.value = param.value + ',' + obj.value;
       i++;
       }while((document.getElementById(id) != undefined) && (document.getElementById(id) != null));
    doSubmit('BTN_DELETE');
    }In your report your column must be something like this:
    apex_item.checkbox (20,
                               a.id,
                               NULL,
                               NULL,
                               'f20_' || '#ROWNUM#'
                              ) delete_checkboxThat way I delete only those who has been checked. You can do that or try
    FOR i in 1..APEX_APPLICATION.G_F01.COUNT LOOP
    END LOOP;But I'm not sure how you notice those who are checked or not that way.. If I remember clearly, it only store those who are checked...
    Edited by: leinadjan on Sep 21, 2011 2:45 PM
    Edited by: leinadjan on Sep 21, 2011 3:37 PM

  • 8.0.2 Updater broken

    So this has probably been addressed before, but does anyone
    have a fix for
    the broken updater? When I try to build my ASP Recordsets I
    get Javascript
    errors.

    Delete the *FileCache*.dat file from the User Configuration
    folder:
    On Windows, the default location is:
    C:\Documents and Settings\[username]\Application
    Data\Macromedia\Dreamweaver 8\Configuration
    Note that the "Application Data" folder is hidden by default,
    so you'll
    need to make sure that your Windows Explorer Folder Options
    are set to
    View Hidden Folders.
    HTH,
    Randy
    > When I try to build my ASP Recordsets I get Javascript
    errors.

  • Spry HTML Datasets on Business Catalyst

    I am venturing into new territory with Business Catalyst, and have FTPd a site to BC that contains a number of Spry HTML Datasets.
    Although the code appears to be correct, and the auxiliary pages are there...I think!...at least the page with the data is there...The Master/Detail presentation is just not working.
    I have used Spry on other pages: collapsible panels, accordions, etc., and they all function well, but are of course self-contained...no data needed from off-page besides the JS and the CSS.
    Has anyone any experience with BC and Spry HTML Datasets? You can find a page at http://chaplaincyinstituteofmaine.businesscatalyst.com/faculty.html
    Beth

    As your are now running on BC, there is no reason to still include the ICE scripts.
    <script src="includes/ice/ice.js" type="text/javascript"></script>
    Delete !
    As for general debugging, i would suggest, installing Firefox, with the firebug plugin. ( www.getfirefox.com & www.getfirebug.com ).
    As the page you supplied suffers from JavaScript Errors. Probably because of the ICE script . 

Maybe you are looking for

  • My Satellite does not turn on

    Hey, I've a satellite M40 which does not power on. I had a message on a blue screen saying: DRIVER_IRQL_NOT_LESS_OR_EQUAL and it shut down right after. When I switch the laptop on the power light flash orange for a second. After 3or 4 other seconds i

  • Moving and renaming image files

    I want to move & rename image files to folders on the hard drive by dragging and dropping them into my application. I read about the problem with renameTo() method with windows. Is this possible to do in java? I heard about a method in which you read

  • How do I align a flex field segment using personalizations?

    This is my first attempt at an OAF form personalization.  I added three DFF segments (read only) to the requisition headers portion of the iProcurement requisitions form.  I'll do my best here to try and show what has happened, I hope this will maint

  • My 8320 cant connect to my Wifi

    I have a wifi router set up in my home and when i run the setup for my BB it says its connected but i still cant cennect using the wifi. When i go into Manage Connections and check Wi-Fi i see a little yellow circle with a horizantal line in it inste

  • Siri doesn't work when held next to head as advertised, how do I fix this?

    I just bought the iPhone 4s.  It's said that Siri will work when held next to head. How do I get this feature to work?