# Node edit dialog in custom node not work

**URL:** https://discourse.nodered.org/t/node-edit-dialog-in-custom-node-not-work/53714
**Category:** General
**Created:** [14 November 2021 12:46 UTC](https://discourse.nodered.org/t/node-edit-dialog-in-custom-node-not-work/53714 "2021-11-14T12:46:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![d0d04m3](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/d0d04m3/32/19965_2.png) [@d0d04m3](https://discourse.nodered.org/u/d0d04m3)
#### Post date: [14 November 2021 12:46 UTC](https://discourse.nodered.org/t/node-edit-dialog-in-custom-node-not-work/53714/1 "2021-11-14T12:46:02Z")

</div>

hi  
I am use TypedInput Select box in my config node  
check in this link  
[https://nodered.org/docs/creating-nodes/edit-dialog](https://nodered.org/docs/creating-nodes/edit-dialog)

but when open this config all value reset in default value ?

```auto
<script type="text/javascript">
    RED.nodes.registerType('ClientConfig',{
        category: 'config',
        defaults: {
            name: {value:"name of config" ,required:true},
            ASDUAddrLeng: { value: "", required:true,validate:RED.validators.number()},
            ASDUAddr : { value: "", required:true},
            IOAaddrLeng:{ value: "", required:true,validate:RED.validators.number()},
            COTaddrLeng:{ value:"", required:true,validate:RED.validators.number()},
            OriginAddr:{ value:"", required:true,validate:RED.validators.number()}
           
           
        },
        
        label: function() {
            return this.name||"ClientConfig";
        },
        oneditprepare: function () {
            var tabs = RED.tabs.create({
                id: "node-config-client-config-tabs",
                onchange: function(tab) {
                    $("#node-config-client-config-content").children().hide();
                    $("#" + tab.id).show();
                }
            });
            tabs.addTab({
                id: "config-client-tab-Application",
                label: this._("Application Layer")
            });
            tabs.addTab({
                id: "config-client-tab-Link",
                label: this._("Link Layer")
            });

            tabs.addTab({
                id: "config-client-tab-option",
                label: this._("option")
            });
       
            $("#node-config-input-ASDUAddrLeng").typedInput({
    types: [
        {
            value: "ASDUAddrLeng",
            options: [
                { value: 1, label: "One Octet"},
                { value: 2, label: "Tow Octet"},
                
            ]
        }
    ]
});

$("#node-config-input-IOAaddrLeng").typedInput({
    types: [
        {
            value: "IOAaddrLeng",
            options: [
                { value: 1, label: "One Octet"},
                { value: 2, label: "Tow Octet"},
                { value: 3, label: "Three Octet"},
                
            ]
        }
    ]
});
$("#node-config-input-COTaddrLeng").typedInput({
    types: [
        {
            value: "COTaddrLeng",
            options: [
                { value: 1, label: "One Octet"},
                { value: 2, label: "Tow Octet"},
             
                
            ]
        }
    ]
});
           
        }
       
    });
</script>

<script type="text/html" data-template-name="ClientConfig">
    <div class="form-row">
        <label for="node-config-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span>name</label>
        <input type="text" id="node-config-input-name" data-i18n="[placeholder]common.label.name">
       
    </div>
 
   

    <div class="form-row">
        <ul style="min-width: 600px; margin-bottom: 20px;" id="node-config-client-config-tabs"></ul>
    </div>
    <div id="node-config-client-config-content" style="min-height:150px;">
        <div id="config-client-tab-Application" style="display:none">
            <div class="form-row">
                <label for="node-config-input-ASDUAddrLeng" style="width: auto;"><i class="fa fa-tag"></i> <span data-i18n="common.label.ASDUAddrLeng"></span>SADU Address Size</label>
                <input type="text" id="node-config-input-ASDUAddrLeng" style="width: 17%;">
                <label for="node-config-input-ASDUAddr" style="margin-left:30px; width: auto;"><i class="fa fa-tag"></i> <span data-i18n="common.label.ASDUAddr"></span>SADU Address</label>
                <input type="text" id="node-config-input-ASDUAddr" style="width: 17%;">
            </div>
            <div class="form-row">
                <label for="node-config-input-IOAaddrLeng" style="width: auto;"><i class="fa fa-tag"></i> <span data-i18n="common.label.IOAaddrLeng"></span>IOA Address Size</label>
                <input type="text" id="node-config-input-IOAaddrLeng" style="width: 17%;">
                <label for="node-config-input-COTaddrLeng" style="margin-left:30px; width: auto;"><i class="fa fa-tag"></i> <span data-i18n="common.label.COTaddrLeng"></span>COT Address Size</label>
                <input type="text" id="node-config-input-COTaddrLeng" style="width: 17%;">

          
            </div>
            <div class="form-row">
                <label for="node-config-input-OriginAddr" style="width: auto;"><i class="fa fa-tag"></i> <span data-i18n="common.label.OriginAddr"></span>Originator Address</label>
                <input type="text" id="node-config-input-OriginAddr" style="width: 17%;">
               

          
            </div>
          
        </div>
        <div id="config-client-tab-link" style="display:none"> </div>
        <div id="config-client-tab-options" style="display:none"> </div>
    
    </div>
   
</script>

<script type="text/html" data-help-name="ClientConfig">
    <p>A simple node that converts the message payloads into all Client characters</p>
</script>

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [13 January 2022 12:46 UTC](https://discourse.nodered.org/t/node-edit-dialog-in-custom-node-not-work/53714/2 "2022-01-13T12:46:03Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
