Using a comfirmation of java script in the recording function delete?

Hello;
I'm writing a confirmation in Java script to delete a record. I don't want to delete all of the information table, just for the record, the button Delete is attached using the identifier. Here is my script, then the code on the page:

< script language = "JavaScript" >
function confirmDelete (id) {}
If (confirm ('are you sure you want to delete this record?'))
{
document. HREF.action = "ProjectCat - Action.cfm?" ID = "+ id;"
document. HREF.submit ();
}
Returns false;
}

< /script >

This is the query that I'm trying to use it:
"< name cfquery ="catMan"datasource =" "#sitedatasource #" username = "#siteUserID #" password = "#sitePassword #" >
SELECT Categories.Name AS ViewField1, HAVE categories. CategoryID ID
Categories
< / cfquery >
< head >
< / head >
< body >
< cfloop query = "catMan" StartRowOptional = "" #URL.startRow # "EndRowOptional =" #endRow #">"
< cfoutput >
#ViewField1 #.
< do action = "ProjectCat - Action.cfm" method = "post" >
< input type = "hidden" name = "ID" value = "#ID #" >
< input type = "submit" name = "proj_Delete" onClick = "return confirmDelete('#ViewField1#')" value = "Remove" > < / make >
< / cfoutput >
< / cfloop >
< / body >

#Note: there is the code here in my query to loop to the next and previous buttons, I just don't have this zip code as it relates to this question.

Is there also a way to make the State of Java script in the place where it says, "Are you sure you want to remove this record" to say "Are you sure you want to delete #ViewField1 #? (the name of the deleted record)?

Thank you!

Phoenix

just spent 2 arguments to your function js - id AND category name:


and function:
function confirmDelete (id, name) {}
If (confirm ('Are you sure you want to delete' + name + 'category?'))
{
document. HREF.action = "ProjectCat - Action.cfm?" ID = "+ id;"
document. HREF.submit ();
}
Returns false;
}

but the creation of a separate form for each category displayed on the page is
very inefficient - you must revise your code... you have not yet
train, really... just use to call your js function, or a
(without any

(Tags) you absolutely
must have a button to click...

---
Azadi Saryev
SABAI - Dee.com
http://www.SABAI-Dee.com

Tags: ColdFusion

Similar Questions

  • Java script in the address bar

    Hi))

    After an update to version 6 has been done, I can't run java script in the address line of the browser

    How can I do in this version?

    You can run is more JavaScript code via the address bar in Firefox 6 and later versions.

    You see an error message in the tools > error Console.

    Now, this code gets a security principal null for security reasons and has no effect (Bug 656433).

    You must create a bookmarklet (keyword) and run the code by invoking this bookmark.

    NoScript can allow you to run this code through the address bar, see:

    .....

    • bug 656433 - do not allow javascript: URLs to be executed from the URL bar

    (please do not comment in bug reports)

  • can I use waiting fuction in java script with qml

    HII guyzz... How to use the wait in java script with QML function as if it takes 20 minutes to perform a specific operation or a process after that battery is 100%

    You are better off using QTimer for something like that.

  • How to connect to an Oracle database using acrobat form field java script actions

    I have a PDF template with buttons and form fields. One requirement is that when a key is pressed, I want to connect to an Oracle database to change the data of the table inside the DB.

    I wrote "Mouse Up" event and set a Java script to run on this event. Java script I am trying to connect to the DB and Transact on the DB.

    Any ideas how to achieve this.

    Thank you.

    Assuming you are using Acrobat (or reader) XI or newer, it is no longer possible.

    There used to be a way to connect to a PDF file using a script and ADBC, a DB defined locally, but Adobe removed in favour of this option progressively and now it is completely obsolete.

    The only type of PDF files that can still do are those created using LiveCycle Designer.

  • Java script to the Dashboard download to Excel

    Hello

    I am well aware that we are unable to download the entire Excel given that only html and pdf options dashboard. The option I think, is to create a button to download java script and I don't know if its possible or not?

    Need your expert advice on this topic. Also are there other ways to download for excel

    Thank you

    Published by: Melinda on July 11, 2012 12:14

    Hello

    You can't directly download all applications on a dashboard to Excel. Click the print of dashboard and select HTML. Save as format of abc.mht.
    Now open the abc.mht with Excel. Not with exactly the same formats, but there it is.

    Hope this helped / answered.

    Concerning
    Young

  • How to add the document level java script to the document via API?

    Hello

    Can someone tell me how to add a document level java script with pdf document?

    Thank you

    Amol

    Here is a link to the JavaScript documentation for the doc.addScript method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.440.html

  • How can I use ODE independently OWD unaided, but showing the record of decision?

    Hi all

    I want to integrate the OPA with my java application without using the OWD.

    But how can I show the record of decision like that of OWD?

    Thank you

    This should be fairly simple. You can obtain a record of decision of the engine API. The decision paper referred is a tree of nodes that are very similar to the decision in OWD HTML report, it should just be a matter of this tree to market and building an html like structure.

    Take a look on example: retrieve a record of decision for an example of how to retrieve a record of decision.

  • Adobe DC Java Script for the population of conditional field

    I have to write a script in a form that will be contained in a text box and populated by one based on the user by checking a box

    Scenario of

    A form contains two sections, there are two sections Head Office information and accounts payable.  The user saves the headquarters address information for example the street address, city, province, PC, etc.  one moves to section 2 two to record accounts payable information.  The Department accounts payable may be located to one address which is not at the headquarters.  There is a check box labeled "same as headquarters" by checking the box that the user is to identify that this is the same address and I want the form automatically fill the street address, city, province, PC already filled in the section of headquarters.  If the user does not identify the address is the same as the location of the headquarters, the user must manually register the information.

    Is not not a technical developer I'm lost, I tried many sites.  I really miss adobe lifecycle designer and the previous method to create actions.  Help, please!

    My JavaScript to date (sorry it must look not so good):

    this.getField("Same").value;

    If (Same.value! = null) {APStreetAddress.value = HOStreetAddress.value}

    This kind of thing can become a little complicated depending on exactly how you want it behaves. It's simple if you only need the script that will be triggered when the check box is selected, in which case the script of mouse upwards to the box could be:

    Script mouse upwards to the box

    (function () {}

    Do nothing if this check box cleared ix.

    If (event.target.value = 'Off') return;

    Copy the values from the previously filled (probably) the text for the other fields.

    getField("APStreeAddress").value = getField("HOStreeAddress").valueAsString;

    getField("APCity").value = getField("HOCity").valueAsString;

    getField("APPostalCode").value = getField("HOPostalCode").valueAsString;

    Add code to the other fields here

    })();

    Just be sure to use the names of real field.

  • Created a Java Script but the need in Spanish

    In Adobe Standard X, I created the following Script for a dynamic buffer

    Event.Value = util.printd (a-mmm-yyyy ", new Date()");

    That would show

    January 5, 2015

    How to say the same thing but in Spanish. I want to display

    5 January-2015

    Windows 7 x 64

    Remove the options to Format selected for this field.

  • Math.power Java script in Captivate 7 function

    I am trying to perform a complex calculation in a 7 Captivate tip action. I can get up now by using the user input and a series of expressions but stop trying to raise a number to a power, so I will try to use the function math.power Java [Math.pow(x,y)]; The problem is that the base number (x) is a variable of captivate (PR) calculated by the previous expression, the exponent (y) is a literal value (0,2857). The result will then return to the advanced Captivate in action for a final calculation, what I can do in a regular expression before being posted. Advice or guidance would be much appreciated. Please keep in mind, I'm an absolute novice with javascript. Thanks in advance.

    When you try to get or set of Captivate variables in combination with advanced Actions and JavaScript, you can run into problems of synchronization.  It is better to do everything in one or the other... or at least start in advanced actions and complete the action advanced with a final stage "execute JavaScript.  So I'll take the last expression in your advanced actrion and which combine in one final step of "Execute JavaScript":

    /* Get a reference to the Captivate DOM element */
    var objCp = document.Captivate;
    
    /* Get the PR Captivate Variable as a Number*/
    var pr = Number(objCp.cpEIGetValue('m_VarHandle.PR'));
    
    /* Do exponent calc */
    var pk = Math.pow(pr, 0.2857);
    
    /* Get the Init_Temp_K Captivate Variable */
    var initTempK = Number(objCp.cpEIGetValue('m_VarHandle.Init_Temp_K'));
    
    /* Calculate the final temp */
    var finalTemp = pk * initTempK;
    
    /* Set the Final_Temp_K Captivate Variable so the answer is visible inside of Cp */
    objCp.cpEISetValue('m_VarHandle.Final_Temp_K', finalTemp);
    

    I commented JavaScript code so hopefully he reads logically.

  • Use about Central button mouse to call the JavaScript function question

    I want to use the mouse middle button to call the function JavaScript (< a href = "javascript:help ()" >) help() opens a new window and directly to the Help Page of my GUI, but when I click on it with the middle button, it will open new tab blank Page that url = "javascript:help()"; " can't help executive function... What is a Firefox Bug or a correct behavior in Firefox? I thank.

    You must use left click to manage JavaScript links.

    See also http://kb.mozillazine.org/browser.link.open_newwindow.restriction

  • get the id of the component using Java Script

    I have three text fields that I am trying to reset it using Java Script in the Joint Strike Fighter. When, in short, all the text fields three triggered event calls the method below and not reset the other two fields to the point.

    I need to know what text field is under discussion, so I can reset the other two.

    The question that I have does not have the correct id name using evt.getSource ();. I get a big long text for txtField, that looks like: AdfRichInputText [oracle.adf.RichInputText] id = it2

    I'm trying to get just "it2", how do I do this?

    < af:resource type = "javascript" >

    function resetFields (evt) {}

    var txtField = evt.getSource ();

    Alert (txtField);

    If (txtField == 'it2') {}

    var var1 = AdfPage.PAGE.findComponentByAbsoluteId ('it1');

    var var3 = AdfPage.PAGE.findComponentByAbsoluteId ('it3');

    var1. SetValue("");

    var3. SetValue("");

    }

    }

    < / af:resource >

    Thank you very much.

    It worked:

    var txtField = evt.getSource ();

    ID var = txtField.getProperty ("id");     -Returns the name of id for the event source.

  • Using java script with QML, save a text in a variable of java script and showing in a label

    I'm trying to find a way to take a text entered by the user into a text field and display it in a label using java script. The trickiest part is I want to be seen in the label after restarting the application.
    Any idea?
    Should I use a JS file with functions. If so, what are best practices?

    Thanks in advance!

    This example uses a little bit of C++, I'm not sure if this can be done with purely JS

    in your text box or label apply onTextChanged you probably want to have a Setup button to activate & deactivate the area of text, or if they delete it, the text of the label would be erased

    . QML

    TextArea {
        id: myTextArea
        onTextChanged: {
            myTextArea.text = myLabel.text;
            //you could also apply ^ to a button's onClicked function etc
            App.saveValueFor("mySavedText" myTextArea.text);
        }
    }
    Label {
        id: myLabel
        text: App.getValueFor("mySavedText", "");
    }
    

    App.saveValueFor (); QSettings uses will have to be reset in your ApplicationUI.cpp & .h

    .cpp

    App is obtained by setting a context property

    qml->setContextProperty("App", this);
    
    QString App::getValueFor(const QString &objectName, const QString &defaultValue)
    {
        QSettings settings;
    
        // If no value has been saved, return the default value.
        if (settings.value(objectName).isNull()) {
            return defaultValue;
        }
    
        // Otherwise, return the value stored in the settings object.
        return settings.value(objectName).toString();
    }
    
    void App::saveValueFor(const QString &objectName, const QString &inputValue)
    {
        // A new value is saved to the application settings object.
        QSettings settings;
        settings.setValue(objectName, QVariant(inputValue));
    
    }
    

    all

    public:
    
        Q_INVOKABLE
        QString getValueFor(const QString &objectName, const QString &defaultValue);
    
        Q_INVOKABLE
        void saveValueFor(const QString &objectName, const QString &inputValue);
    

    You'll also need to slect the permission of files shared in the descriptor for QSettings bar to work

  • Using the eval() function in Table DDL Transformation Scripts

    Hello

    I would like to run a stand-alone file java script in the script after you create and the events of the end of the Script. According to the Oracle documentation, there are several ways to do so: https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/prog_guide/api.html

    Only the first way seems to work:

    Suggestions, please

    Alek

    Hi Alek,

    you try to use the JavaScrpt JavaScript eval() function eval() function

    and as I see that it works as expected. You need to get your engine and use the eval function.

    Following works for me:

    var manager = new Packages.javax.script.ScriptEngineManager();
    engine = manager.getEngineByName("nashorn");
    s = engine.eval("1+2");
    fr = java.io.FileReader("d:/temp/inc.txt");
    k = engine.eval(fr);
    

    Philippe

  • Setting the value of XML in Java script tag

    Hello

    I'm trying to set a value of XML tag in the initialize to a text field event... The code works correctly in FormCalc but I needed it to work in java script.

    FormCalc:

    $record.prospectApplication.typeName = "namedInsured";

    Java Script:

    xfa.record.prospectApplication.typeName = "namedInsured";

    The JavaScript above does not work. Can help any one on this?

    Thank you

    Srini

    Hi Srini,

    In JavaScript you do get all properties by default if you need to say;

    xfa.record.prospectApplication.typeName.value = "namedInsured";

    Who is assign the value to the property "value" not the dataValue object.

Maybe you are looking for