This topic is locked

Field not aligned correctly after updating the field value in Javasscript

6/3/2020 2:05:45 AM
PHPRunner General questions
J
jacktonghk authorDevClub member

I have this code in one of my field event to update the gross_amt on the fly. However, I found the field was not aligned correctly. It was shifted up like superscript and made the screen looks weird.
pageObj.findItem('gross_amt').text( parseFloat(value).toFixed(2) );

Sergey Kornilov admin 6/3/2020

Screenshot?

J
jacktonghk authorDevClub member 6/5/2020



Screenshot?


You can see the 5400.00 of the gross amount is superscripted.

Sergey Kornilov admin 6/5/2020

Thank you, makes sense.
Use Javascript Control API and setValue() function. It looks like there is a span HTML element there which you are removing while using jQuery's text() function.

https://xlinesoft.com/phprunner/docs/ctrl_setvalue.htm

J
jacktonghk authorDevClub member 6/5/2020



Thank you, makes sense.
Use Javascript Control API and setValue() function. It looks like there is a span HTML element there which you are removing while using jQuery's text() function.

https://xlinesoft.com/phprunner/docs/ctrl_setvalue.htm


How can I get the pageid of the master page if I invoke the calculation from the detail page? Thanks.