1
0
-1

Greetings - I have javascript question, so excuse the lack of programming language.


I am monitoring for text field changes and it works fine with the following snippet line:

...
$('input[name="status_current"], input[name="status_new"]').change( function(){
....

The "input" above doesnt work with select box where you change the value based on the dropdown value.

is there a different method I can use?

thanks

Tony




    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Hi, instead of $('input') you should try to use Javascript API#getField(fieldId).

        CommentAdd your comment...
      1.  
        1
        0
        -1

        try to use below to get the value of the option selected

        $('select').on('change', function() {
        alert( this.value );
        });



        1. Anthony Sica

          Hi - thank you for your input. I tried both methods, but it wont fire... I would like to fire when the select box called "PONumber" changes value. in this example, I simply read the value of the iAmount and update "POImpact" accordingly.

          <script>

          $(getField("PONumber")).change( function(){
                var iAmount = Number.parseFloat(FormUtil.getValue("Invoice_Amount").replace(/[^0-9\.-]+/g,""));
                $('input[name="POImpact"]').val(iAmount);
          });

          $("PONumber").on('change', function() {
                var iAmount = Number.parseFloat(FormUtil.getValue("Invoice_Amount").replace(/[^0-9\.-]+/g,""));
                $('input[name="POImpact"]').val(iAmount);
          });

          </script>

        2. Anders

          It should be FormUtil.getField("PONumber") instead of just getField("PONumber")

        CommentAdd your comment...