Questions and discussion about using ProcessMaker 2: user interface, running cases and functionality
Forum rules: Please search to see if a question has already been asked before posting. Please don't ask the same question in multiple forums.
By afsaneh
#812494
Hi

I want to change the background color using the following commands but it does not work correctly
The amount is taken through the dynaform
Thanks


$("#sumval").getControl().change( function() {

if (parseFloat($("#sumval").getValue())>= 5000000)
$("#sumval").getControl().css("backgroundColor", "red");
//$("#sumval").getHintHtml()[0].style.color="red"
else
$("#sumval").getControl().css("backgroundColor", ""); //set border to its default color
} );
User avatar
By ashkufaraz
#812498
Try this code
Code: Select all
$("#sumval").setOnchange( function() {

    if (parseFloat($("#sumval").getValue())>= 5000000)
        $("#sumval").getControl().css("backgroundColor", "red");
//$("#sumval").getHintHtml()[0].style.color="red"
    else
        $("#sumval").getControl().css("backgroundColor", ""); //set border to its default color
} );
You must use setOnchange event...
User avatar
By amosbatto
#812512
If you run into some weirdness where getValue() is returning the previous value, then try this:
Code: Select all
$("#sumval").setOnchange( function(newVal, oldVal) {
    if (parseFloat(newVal)>= 5000000)
        $("#sumval").getControl().css("backgroundColor", "red");
    else
        $("#sumval").getControl().css("backgroundColor", ""); //set background to its default color
} );
(This is probably only a problem in some old versions, like 3.0.0.5.)
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]