Ticket T349939
Visible to All Users

dxForm - How to get field value

created 9 years ago

[DevExpress Support Team: CLONED FROM T343689: How to get a value of an editor in dxForm]
Hi Nicolai,

I have config dxForm like this:
$scope.contactForm = {
                         item: [{
     data

JavaScript
[JScript] $scope.contactForm = { colCount: 2, items: [{ itemType: "group", caption: "Contact Detail", items: [{ dataField: "Mobile Number", editorOptions: { mask: "+84 (X000) 000-0000", maskRules: { "X": /[02-9]/ } } }, { dataField: "Email", editorOptions: { disabled: false }, }] }] };
JavaScript
Then I typing in Email field. How can I get value or (text) in that field?
Comments (1)

    I also tried this and does not work:

    @(Html.DevExtreme().DataGrid()
        .ID("grid-container")
        .ShowBorders(true)
         .OnEditorPrepared("oneditprepared")

    function oneditprepared(e) {

    if (e.dataField === "ComponentClassId") {
                var cc = e.editorElement.dxSelectBox("instance");
                var ct = e.editorElement.dataField("ComponenTypeId").dxSelectBox("instance");
                cc.on("valueChanged", function (args) {
                    var selectVar = args.value;
                    e.setValue(args.value);
                    ct.getDataSource().filter(['ComponentClassId', '=', selectVar]);
                    ct.getDataSource().load();
                });
            }

    }

    Answers approved by DevExpress Support

    created 9 years ago (modified 9 years ago)

    Hi Jack,

    Use the dxForm.getEditor method as shown below:

    JavaScript
    var email = formInstance.getEditor('Email').option('value');
      Show previous comments (1)
      Alex Skorkin (DevExpress) 9 years ago

        Hi Jack,

        I recommend that you refer to the Change Options section in the Working with Widgets topic where this inquiry is described.

          Thanks Alex,

          I resolved it.

          JavaScript
          formInstance.updateData("FieldName_ToUpdate", getValue(formInstance, "FieldName_GetValue"));
          Alex Skorkin (DevExpress) 9 years ago

            You are welcome, Jack.

            Feel free to contact us if you need further assistance.

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.