Skip to content
Related Articles

Related Articles

jQWidgets jqxTextArea valueMember Property

Improve Article
Save Article
  • Last Updated : 23 May, 2022
Improve Article
Save Article

jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful, optimized, platform-independent, and widely supported framework. The jqxTextArea represents a jQuery Text area widget that is used to insert text content inside the textbox.

The valueMember Property is used to set or return the valueMember of the Items in the jQWidgets. It represents the name of an object property for which the ‘value’ of the list items, is to be set. It accepts String type values and its default value is empty.

Syntax:

  • Set the valueMember property:
$("Selector").jqxTextArea({ valueMember: 'lastName' });
  • Return the valueMember property:
var vm = $('Selector').jqxTextArea('valueMember'); 

Linked Files: Download jQWidgets from the given link. In the HTML file, locate the script files in the downloaded folder.

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxtextarea.js”></script>

Example: The below example illustrates the jqxTextArea valueMember Property in jQWidgets.

HTML




<!DOCTYPE html>
<html lang="en">
  
<head>
    <link rel="stylesheet" href=
        "jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" 
        src="scripts/jquery-1.11.1.min.js">
    </script>
    <script type="text/javascript" 
        src="jqwidgets/jqxcore.js">
      </script>
    <script type="text/javascript" 
        src="jqwidgets/jqxbuttons.js">
      </script>
    <script type="text/javascript" 
        src="jqwidgets/jqxscrollbar.js">
      </script>
    <script type="text/javascript" 
        src="jqwidgets/jqxtextarea.js">
      </script>
</head>
  
<body>
    <center>
        <h1 style="color: green;">
            GeeksforGeeks
        </h1>
  
        <h3>
            jQWidgets jqxTextArea valueMember Property
        </h3>
  
        <textarea id='jqxTA'></textarea>
    </center>
  
    <script type="text/javascript">
        $(document).ready(function () {
            var data = [{
                "id": 1,
                "name": "Akash",
                "address": "Noida"
            },
            {
                "id": 2,
                "name": "Deepak",
                "address": "Noida"
            },
            {
                "id": 3,
                "name": "Rakesh",
                "address": "Delhi"
            },
            {
                "id": 4,
                "name": "Adarsh",
                "address": "Delhi"
            },
            {
                "id": 5,
                "name": "Arun",
                "address": "Noida"
            },];
  
            $('#jqxTA').jqxTextArea({
                source: data,
                placeHolder: "Name:",
                displayMember: "name",
                valueMember: "address",
                width: 250,
                height: 100,
                placeHolder: 'Enter Name...'
            });
  
            $("#jqxTA").on('select', function (event) {
                if (event.args) {
                    var item = event.args.item;
                    if (item)
                        alert("Name: " + item.label 
                        + " Address: " + item.value);
                }
            });
        });
    </script>
</body>
</html>


Output:

 

Reference: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxtextarea/jquery-textarea-api.htm


My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!