Defining limit - TextArea

Is there any helping code for textarea so that I can define character limit specifically it could accept 100 lines & overall accepted text 1000 characters.

"Name": "ABC",
	    "Title": "ABC:",
	    "Required":"1", 
	    "Description": "Enter the ABC Details.",
	    "UIType": "Texarea", 
	    "DataType" : "Text"

I’m not familiar with this data structure you’re showing, but for parameterized fixlets some basic HTML formatting can accomplish what I think you’re asking, with the ‘maxlength’ textarea attribute.

https://www.tutorialspoint.com/How-to-limit-the-number-of-characters-entered-in-a-textarea-in-an-HTML-form

Thanks Jason but thats not HTML I believe !

I used below doc for the ref & creation, its very old and not updated since very long time.

https://bigfix-wiki.hcltechsw.com/wikis/home?lang=en-us#!/wiki/BigFix%20Wiki/page/Creating%20parameterized%20fixlets

Page no 17

<INPUT id=ticket name=ticket><br>
<TEXTAREA id=txtbx rows=30 cols=50></TEXTAREA>
<script>
    function _takeAction() {
	var txtbx = document.getElementById( 'txtbx' ).value.toString();
	var theTicket = document.getElementById( 'ticket' ).value.toString();
	var concatenatedTxt = "";
				
	if (theTicket == "" ) {
		alert("Ticket Number Required!");
		return;
	}
	if (txtbx == "" ) {
		alert("At least one input required Required!");
		return;
	}
	
	var lines = txtbx.split("\n");
	for (var i = 0; i < lines.length; i++){
		if (lines[i].length > 0 ){ 
			if (concatenatedTxt.length!=0){
				concatenatedTxt += ";"; 
			}
			concatenatedTxt += lines[i].replace(/(\n|\r)+$/, '');
		}
	}
								
	TakeSecureFixletAction( Relevance('id of current fixlet'), Relevance('id of current bes site'), "Action1", {ticket: theTicket, textbox: concatenatedTxt}, { } );
}
document.body.ontakeaction = function() { _takeAction(); return false; 
</script>

Here is an example of something I wrote using HTML Form with TextBox and an input parameter. I do have error-code to force user to populate parameters and then I parse the TextBox to semi-comma separated string which I then pass to the ActionScript. You should be able to rewrite it to match your case with lines.length > 100.

2 Likes