Comparing  Two Items in javascript

I TRY BELOW CODE BUT IT IS NOT WORKING , PLEASE HELP ME TO COMPAR TWO VALUE OF ITEM WITH JAVASCRIPT
WHAT CHANGE I HAVE TO DO , IN BELOW CODE.
LOGIC IS IF P25_VAL1 = P25_VAL2 THEN MQTY = SQTY
function mfgsal()
function getVal(item){
if($x(item).value != "")
return parseFloat($x(item).value);
else
return 0;
if ( parseInt($v('P25_VAL1')) = ( parseInt($v('P25_VAL2'))) {
$x('P26_SQTY').value =
($x('P26_MQTY').value );
}

Kanaiya Sindhavad wrote:
I TRY BELOW CODE BUT IT IS NOT WORKING , PLEASE HELP ME TO COMPAR TWO VALUE OF ITEM WITH JAVASCRIPT
WHAT CHANGE I HAVE TO DO , IN BELOW CODE.
LOGIC IS IF P25_VAL1 = P25_VAL2 THEN MQTY = SQTYDon't shout, and always post code wrapped in <tt>\...\</tt> tags.
if ( parseInt($v('P25_VAL1')) = ( parseInt($v('P25_VAL2')))"=" is the assignment operator in JavaScript, not used to test for equality. And the brackets dont match. It should be "===" (comparing both type and value):
if ( parseInt($v('P25_VAL1')) === parseInt($v('P25_VAL2')))

Similar Messages

  • Compare two pdfs in javascript.

    Hi Friends,
    I am using the following code to open two pdfs and call "Compare documents" menu item after.
    But it is not working out.kindly help me with the correct code.
    All replies are appreciated.
    function 
    comparePdf() { 
    var previouDoc = app.openDoc("C:\Deepak\TED Pdfs\f1t801_.pdf"); 
    var latestDoc = app.openDoc("C:\Deepak\TED Pdfs\f1t802_.pdf");app.execMenuItem(
    "CompareDocuments"); 
    Regards
    Deepak.

    Hi Santosh,
    I am specifically looking for such feature in LC designer. I mean though workbench with processes, if we can create something like that.
    Let me know if u have any idea.
    Thanks

  • Compare two values input by user in JavaScript

    Hi, there,
    I have two text input boxes in my form, and user can input some value in the boxes. I want to check if the values in these two boxes are numerical and compare them in my JavaScript function. How can I do this?
    Thanks in advance.
    Fred

    Hi,
    You can make use of this code. You can user parseInt, which parses a string argument and returns an integer of the specified base.
    <html>
    <head>
    <script>
    function testCompare()
    var x = parseInt(document.myFrm.a.value);
    var y = parseInt(document.myFrm.b.value);
    if( x > y)
    alert ("X is greater");
    else
    alert("Y is greater");
    </script>
    </head>
    <body>
    <form name = myFrm>
    <input type = text name = a value = 100>
    <input type = text name = b value = 200 >
    <input type = button value = click onclick = testCompare()>
    </form>
    </body>
    </html>
    Hope this helps.
    Thanks,
    Senthil_Slash

  • How to compare dates between two items

    Hello all,
    I am trying to compare dates in two items.
    The first item is a computation P45_PAGE_LOADED_TIME
    select sysdate from dual;
    This essentially keeps track of when the user opened the form. They are accessing data that may become obsolete while they are in the form.
    So we have a dynamic action that finds the last_update date from a table. This field is of type date. It is placed in a text field called P45_STATUS.
    We then have a notification which we want to fire when P45_PAGE_LOADED_TIME is before P45_STATUS. We tried the following condition
    declare
    least_date date;
    begin
    SELECT LEAST(TO_DATE(:P45_STATUS),TO_DATE(:P45_PAGE_LOADED_TIME)) into least_date
    from dual;
    if least_date = to_date(:P45_STATUS) then
    return false;
    else
    return true;
    end if;
    end;
    Any guidance would be most appreciated.
    Thanks

    Maybe your better off putting your anonymous block into a plsql function.
    A function that you can test. If it works in plsql then you must call it in APEX.
    I kinda get a headache when I see that least, to_date, to_date query (although I've seen worse :p)
    Make it like:
    create or replace function fun_least_date(in_status in varchar2,
                                                               in_page_loaded_time varchar2) return boolean
    is
      l_status date;
      l_page_loaded_time date;
      least_date date;
      l_return boolean;
    begin
      l_status := to_date(in_status, 'FORMAT MASK!!!');
      l_page_loaded_time := to_date(in_page_loaded_time, 'FORMAT MASK!!!!');
      least_date := least(l_status, l_page_loaded_time);
      if least_date = l_status then
        l_return := false;
      else
        l_return := true;
      end if;
      return l_return
    end fun_least_date;If your sure that your function is correct then use it as a condition for your dynamic action.
    Regards
    Nico
    ps: I haven't tested that function. Be aware that you most correctly enter the format mask you use in APEX. Also before APEX may know about these variables you should set a dynamic action on your items to always submit their value to the server when they change!!!

  • Problem with comparing text item with hidden item

    Hi all,
    I have two items, one text field which has a user name and other item which is hidden which also has a username input from a file.
    I want to compare these two items.
    But when both items are text fileds am able to compare, but when one is made hidden unable to compare.
    Please help on this......
    thanks,
    Srini

    Hi Srini,
    As long as you understand that the user can change the value of ANY field, even it is hidden, then I would suggest something like:
    1 - Hide your existing Login button. On the button definition, in "Button Display Attributes" add the following into the Attributes setting:
    style="display:none"2 - In the Login region's Region Footer, create a new button:
    &lt;input type="button" class="t12Button" value="Login" onclick="javascript:checkNames();"&gt;(Note that I have used a class name of "t12Button" - change this to match your current theme)
    3 - Underneath that, add in your javascript:
    &lt;script type="text/javascript"&gt;
    function checkNames()
    if ($v('field1name') == $v('field2name'))
      doSubmit('loginbuttonname');
    &lt;/script&gt;Then, when the user clicks the new Login button, this triggers your javascript. This checks that the values for field1name and field2name match. If they do, if fires the normal submit for the page (the same as if you clicked the original Login button)
    Andy

  • Functinality to compare two material price with reference to BOM in CO

    Hi All,
    Is there is any functionality in Controlling which can compare the costing for two FERT materials.
    or
    is there is  any functionality where we can compare two material price with reference to BOM in controlling
    Please help me to compare the material price with reference to BOM
    Regards
    nandu

    Hi,
    You can use this report to compare two itemizations. The report compares the characteristics item number, item category, cost element, resource, material, cost center, plant/work center, cost center/activity type, operation number, BOM item, assembly indicator, and cost component.
    You can access this report as follows:
    Accounting ® Controlling ® Product Cost Controlling ® Product Cost Planning ® Material Costing ® Cost Estimate with Quantity Structure or Cost Estimate Without Quantity Structure ® Compare
    or
    Accounting ® Controlling ® Product Cost Controlling ® Product Cost Planning ® Information System ® Object Comparisons ® For Material ® Itemization Comparison.
    For Detail Please reffer following link:
    http://help.sap.com/saphelp_46c/helpdata/en/56/abd108f1a611d28a950000e8214595/content.htm
    Thanks and Regards
    Binoj M D

  • How to show two items using $f_Show_On_Value_Item_Row

    Hi,
    I have a select list with values with Yes, No and two items(1 check box, 1 text field) below it.
    I want to show two items if i select 'Yes' in select list.
    I am able to show/hide one item using onchange="$f_Show_On_Value_Item_Row(this,'P1_A_EMAIL_PERS_REQ','Yes');"
    How can i pass two items to this function.
    Thanks for ur help in advance
    Regards,
    Ram

    Ram,
    Rather than putting the call to $f_Show... inline with the onchange handler, create a separate function and call that function does the work and call that function instead. See this thread for some more details:
    Problem when calling more than 1 Javascript function
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen

  • Compare two pdf files using adobe acrobat through command line

    Does anyone know how to compare two pdf files using adobe acrobat through command line. I want to do this via command line because we want to compare hundreds of file every day through some automated windows tasks.
    If command line option is not available in acrobat, then is it feasible to make use of acrobat javascript API to do this task?
    Any kind of help will be greatly.

    Command-line: Not possible.
    JavaScript: Possible, but very limited. Basically the only thing you can do is simulate clicking the Compare Documents button. The rest has to be done manually.
    However, it *might* be possible to automate this process a bit more using a plugin. Ask over at the Acrobat SDK forum for more information...

  • Performance issues comparing two vectors

    I need some advice on what is the fastest way to compare two vectors. My question is all about performance;
    I have two vectors one(Vect A) of which has more than 20000 string values and the other Vector B would hold typically around 200 strings.I compare them both to find out if Vector B has values in Vector A and remove those.
    I iterate thro each element in a loop from the smaller to the bigger vector comparing element by element.But it takes a long time.
    Is there any quick way to do this comparison and can I use contains/compare methods instead of iterating thro the vectors.will it speeden up things
    Arn

    first of all, you should probably examine your collection choice and make sure that java.util.Vector is your best option (assumming you can change the class). Do not use a Hashtable as the previous poster suggested- it doesn't sound like you have a key/value type relationship in your elements, making a Map implementation superflous. Will there be duplicate elements in either Collection? If you will not have duplicate elements, you should probably use a Set collection instead of a List. Does your collection have to be thread-safe? If not, one of the unsynchronized collections should give you better performance (e.g. ArrayList should be quicker then Vector). For the best possible performance, you could use an ordered collection and write your own comparator, so that it does not iterate beyond what ever element assurres that there is no match (i.e. if the first element is "fred" in an ordered collection, you know there will be no match for "adam"). Sun has some good tutorials on the java.util.Collection package that will help you understand the benefit of each implemenation...
    although, and I suppose this is neither here nor there, I wouldn't use java objects to sort through 20K string items- sounds like storing them in a database might be superior. Take care.

  • Comparing two XML using DOM

    Hi All,
    I am comparing two XML nodes having same nodes using DOM parser.
    <?xml version="1.0"?>
    <compare value="xml1"/>
    < test name="java">
          <compare value="xml">
              <node>012</node>
    </compare>
    </test>
    < test name="java1">
          <compare value="xml2">
              <node>013</node>
          </compare>
          <compare value="xml3">
              <node>014</node>
         </compare>
    </test>I need to take <compare> and <node> present inside <test> tag.
    I am not getting the results properly if i am using the following code
    NodeList bList1 = doc.getElementsByTagName("compare");
                        for (int temp1 = 0; temp1 < bList.getLength(); temp1++) {
                          Node nNode = bList.item(temp1);
                          NamedNodeMap attributes = (NamedNodeMap)nNode.getAttributes();
                                          for (int g = 0; g < attributes.getLength(); g++) {
                                              Attr attribute = (Attr)attributes.item(g);
                                              System.out.println(" Attribute: " + attribute.getName() +
                                              " with value " +attribute.getValue());
                                           if (nNode.getNodeType() == Node.ELEMENT_NODE) {
                        Element eElement = (Element) nNode;
                                          NodeList nlList= eElement.getElementsByTagName("node").item(0).getChildNodes();
                    Node nValue = (Node) nlList.item(0);
                    String node = nValue.getNodeValue();
    }is there any possibility to get the <compare> and <node> tag present inside <test> tag...

    2nd xml
    <?xml version="1.0"?>
    <compare value="xml1"/>
    < test name="java">
          <compare value="xml">
              <node>012</node>
    </compare>
    </test>
    < test name="java1">
          <compare value="xml2">
              <node>015</node>
          </compare>
          <compare value="xml3">
              <node>016</node>
         </compare>
    </test>
    Map m1= new HashMap();
    NodeList bList1 = doc.getElementsByTagName("compare");
                        for (int temp1 = 0; temp1 < bList1.getLength(); temp1++) {
                          Node nNode = bList1.item(temp1);
                          NamedNodeMap attributes = (NamedNodeMap)nNode.getAttributes();
                                          for (int g = 0; g < attributes.getLength(); g++) {
                                              Attr attribute = (Attr)attributes.item(g);
    m1.put (attribute.getName(),attribute.getValue());
                                           if (nNode.getNodeType() == Node.ELEMENT_NODE) {
                        Element eElement = (Element) nNode;
                                          NodeList nlList= eElement.getElementsByTagName("node").item(0).getChildNodes();
                    Node nValue = (Node) nlList.item(0);
                    String node = nValue.getNodeValue();
    m1.put ("node");
    Map m2= new HashMap();
    NodeList bList2 = doc1.getElementsByTagName("compare");
                        for (int temp1 = 0; temp1 < bList2.getLength(); temp1++) {
                          Node nNode1 = bLis2.item(temp1);
                          NamedNodeMap attributes = (NamedNodeMap)nNode1.getAttributes();
                                          for (int g = 0; g < attributes.getLength(); g++) {
                                              Attr attribute = (Attr)attributes.item(g);
    m1.put (attribute.getName(),attribute.getValue());
                                           if (nNode1.getNodeType() == Node.ELEMENT_NODE) {
                        Element eElement = (Element) nNode1;
                                          NodeList nlList= eElement.getElementsByTagName("node").item(0).getChildNodes();
                    Node nValue = (Node) nlList.item(0);
                    String node = nValue.getNodeValue();
    m2.put ("node");
                        List<Map.Entry<String, String>> results =
                                new ArrayList<Map.Entry<String, String>>();
                        Set<Map.Entry<String, String>> s1 = m1.entrySet();
                        Set<Map.Entry<String, String>> s2 = m2.entrySet();
                            results =
                                                        new ArrayList<Map.Entry<String, String>>();
                        for (Map.Entry<String, String> entry : s1) {
                            if (!s2.contains(entry)) results.add(entry);
                        for (Map.Entry<String, String> entry : s2) {
                            if (!s1.contains(entry)) results.add(entry);
                        System.out.println(results);Like this I am comparing :
    I need to get the attribute value of <compare> and body value for
    <node> tag and need to compare the values in both XML.

  • Compare two table columns

    hi all,
    i am using db10g.
    my task is to compare two table's data for example
    table1 is having
    col1 col2 col3
    a b c
    e f g
    table2 is
    col4 col5 col6
    a e c
    e f g
    so i have to compare col1 first record and col4 first record.
    in otherwords first table first column first item with second table first table first value and so on.
    for ex: a= a
    b= e
    c= c etc
    how can i acheive this?
    both are database tables.
    i cannot use minus function because data types are different for the corresponding column
    how can i compare it?
    Thanks..
    Edited by: user13329002 on Jan 13, 2011 1:09 AM

    Hi,
    Try this
    select
        case
            when a.col1 = b.col1 then 'EQUAL' else 'NOT EQUAL' end column1,
        case
            when a.col2 = b.col2 then 'EQUAL' else 'NOT EQUAL' end column2,
        case
            when a.col3 = b.col3 then 'EQUAL' else 'NOT EQUAL' end column3 
    from (select col1,col2,col3,rownum rn from table1) a,
                                (select col1,col2,col3,rownum rn from table2) b where a.rn = b.rn Try to see how you order the rows of the two tables.
    cheers
    VT

  • Relating two items

    I have two items that I need to relate together. One is a abbreviation and the other is a full text value. If the abbrevation changes I need to change the full text. Is that possible?

    Are you talking about javascript or serverside.
    If javascript you could look at onchange=jsciptFunction();

  • Compare two different iPhoto Libraries

    Is there any program that could compare two iPhoto Libraries and let me know the difference between them? I've got two libraries, they should have the same pictures, but for some reason one is 80GB bigger than the other one.
    I know there are duplicates, but 80GB seems a lot for only duplicates, so I want to compare both of them and see what pictures are missing.

    How many photos does iPhoto indicate in each of the libraries? Open the Photo mode, do a select all and see how many are indicated at the bottom of the window. See if that corresponds to the number beside the Photos icon under the Events library. Be sure to turn on Item Counts in iPhoto's General preference pane.
    Which is the larger: the old or the new?
    OT

  • How to compare two PDF documents?

    Hi i need to compare two PDF documents. Is there any way to do this using javascript or applescript.or SDK
    Im new to PDF scripting...
    Please someone help me.....
    thanks in advance....
    Subha

    Need to compare the difference between two PDF which should include font, style, text, spelling comparision and need to produce the report which should tell the difference.

  • How to compare two dates that should not exceed morethan 3 years

    hi all,
    can you please tell me how to compare two dates( basically dates are string type)
    that should not exceed more than 3 years? in JAVASCRIPT
    Thanks in Advance.

    This is not a JavaScript forum.
    [*Google* JavaScript Forum|http://www.google.co.uk/search?q=JavaScript+Forum&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a]
    Good luck.

Maybe you are looking for

  • Build error while creating 32-64 universal binary

    Hi All, I have to build a bundle in Xcode as part of development. While building 32-bit universal, it is not giving any issues. But when I keep 32-64bit universal, I am getting so many build errors. As I have windows background, pretty new to Mac, so

  • Strange behavior when creating a document with an "html" node

    A strange thing is happening here. I'm using the javax.xml.transform.Transformer to save some XML documents. I can create documents with any arbitrary DOM tree I want, but if I have the root node have a name of "html". somehow the Transformer decides

  • External hard drive as main libary

    I have a powerbook with a crappy 20GB HD so i want to use my 260GB Lacie HDD to store my music and run my itunes from. How do i set this up. I'm new to the mac world, i got this powerbook for free and want to use it just for my ipod & music. help ple

  • Check space in the end to display warning message.

    I am currently working on validations on functional locations in the EDIT MASK. the code is already written for validations on to check for space in the beginning of the each level in the edit mask. however user requirement is that the program should

  • Enter Key in a Tree!!

    Hi, i have a JTree and the nodes of this tree can be removed, edited and viewed. I have assigned the double clik of the mouse in a node with the modification action, but know i also want to assign the pressing of the ENTER key with this action. Can a