Web Component S_007TX: Text Area

LANSA

Web Component S_007TX: Text Area

<!-- In this component: -->
<!-- TEXTAREA NAME is the name of your base field padded with trailing blanks to 10 characters -->
<!-- This means that the eleventh (11t) position of the field name must be the '-' character -->
<!-- -L075 is the field length as defined in the repository or function where 'Lnnn' indicates the-->
<!-- desired apportionment length. If omitted, a length of 256 is assumed. -->

<RDML CHECKVALUE="YES">
<TEXTAREA NAME="S_007TX -L075" COLS=55 ROWS=10 WRAP="PHYSICAL" onKeyPress="return CountIt(this.value)">
<RDML MERGE="S_007TX ">
<RDML MERGE="S_007TX01 ">
<RDML MERGE="S_007TX02 ">
<RDML MERGE="S_007TX03 ">
<RDML MERGE="S_007TX04 ">
<RDML MERGE="S_007TX05 ">
<RDML MERGE="S_007TX06 ">
<RDML MERGE="S_007TX07 ">
<RDML MERGE="S_007TX08 ">
<RDML MERGE="S_007TX09 ">
<RDML MERGE="S_007TX10 ">
</TEXTAREA>
</RDML>


<!-- A TEXT AREA has a limited number of characters that can be typed in. The limit is set by the sum of the length of its -->
<!-- fields. This TEXT AREA has been defined with 11 fields (S_007TX through S_007TX010), each of them 75 characters long. -->
<!-- Hence, the limit is 75 * 11 = 825 characters. That value is calculated in the RDML function SET007A and sent in the field
<!-- #MAXCHAR. Each time a character is typed into the TEXT AREA, the Java Script function below will be invoked and verify -->
<!-- that the limit has not been surpassed. If it has, an alert message is shown. -->

<SCRIPT>
function CountIt(TextEntered)
{
var maxlength = <RDML MERGE="MAXCHAR">;
var length;
var thisString;
thisString = TextEntered;
length = thisString.length;
if (length > (maxlength - 1))
{
alert("You have reached the limit of " + maxlength + " characters you can type." );
return false;
}
return true;
}
</SCRIPT>