Page 1 of 1

how to recognize input or text?

Posted: 23 Jul 2022, 08:30
by Dino
Let's say you have a screen like this:
axes01.png
axes01.png (40.03 KiB) Viewed 5725 times
and you identify the input field as input01, and the text field as txt02.
but sometimes when you get to this screen, txt02 happens to be an input field.

so I want to be able to know from the script in aXes if it is an output text, or an input field.

checking in the developer tools, I can see that this is the code associated with this two fields:

Code: Select all

<div id="ifld602" class="ax-terminal-field x24 ui-widget" title="" style="top: 112px; left: 15px; visibility: visible; width: 26px; height: 21px;">
<input type="text" maxlength="2" size="2" class="ax-terminal-inputField ax_x24i ui-widget-content" style="width: 26px;"></div>

<div id="text607" class="ax-terminal-field x20 ui-widget" title="" style="top: 112px; left: 80px; visibility: visible; width: 117px; height: 21px;">
<span class="ax-terminal-textField ax_x20o" style="">  QPASVRS</span></div>
the input field is inside a div that starts with ifldxxx and the text file is inside a div that start with txtxxx.

Can I read that name from the script in aXes?

I have tried a silly

Code: Select all

alert(FIELDS("txt02").getProperty("id"));
but getProperty do not get me that close. maybe need to indicate some sort of parent. Any ideas?

Re: how to recognize input or text?

Posted: 23 Jul 2022, 08:50
by Dino
nevermind, found the solution.... I just ask for the Element in that row and colum... if I find an ifld, then i know is an input field. If I found a text in that row, column, it is an output field.

Code: Select all

var theElement = document.getElementById("ifld607");
if (theElement === null)
{
    var theElement = document.getElementById("text607");
    if (theElement === null)
        alert("nothing here")
    else
        alert("output field");
}
else
    alert("input field");

Re: how to recognize input or text?

Posted: 26 Aug 2022, 14:40
by tim mcentee
aXes has a utility for this
FIELD.isInputField
or
FIELDS("myField").isInputField