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.)

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]

Betvisa clone scripts are pre-built software solut[…]

A Bet365 Clone Script is essentially a ready-made […]