# Editable list validate with external value

**URL:** <https://discourse.nodered.org/t/editable-list-validate-with-external-value/68335>\
**Category:** General\
**Created:** [28 September 2022 09:35 UTC](https://discourse.nodered.org/t/editable-list-validate-with-external-value/68335 "2022-09-28T09:35:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alevher](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/alevher/32/65952_2.png) [@alevher](https://discourse.nodered.org/u/alevher)\
**Post date:** [28 September 2022 09:35 UTC](https://discourse.nodered.org/t/editable-list-validate-with-external-value/68335/1 "2022-09-28T09:35:25Z")

</div>

Hello Everyone,

I'm tryng to validate a value of an editable list based on the value of a checkbox of the node, is it possible ?  
I'd like to check if value3 is not " " only if the checkbox duplicates is checked.

here's the code:

```auto
defaults: {
      name: { value: "" },
      table1: {
        value: "",
        required: true,
      },
      table2: {
        value: "",
        required: true,
      },
      joinType: {
        value: "INNER JOIN",
        required: true,
      },
      distinct: {
        value: false,
        required: false,
      },
      duplicates: {
        value: false,
        required: false,
      },
      outputName: { value: "" },
      props: {
        // Entry containing all the items of the list
        value: [
          // Default items in the list
          ...DEFAULT_LIST_VALUES_JOIN,
        ],
        validate: function (v, opt) {
          for (var i = 0; i < v.length; i++) {
            // Items name must not be null or empty
            if (v[i].value1 === undefined || v[i].value1 === "" || v[i].value2 === undefined || v[i].value2 === "")
              return RED._(
                "@sss/node-red-sss-joinmatrix/joinmatrix:join.errors.invalid-name"
              );
            if (v[i].value3 === undefined || v[i].value3 === "")
              return RED._(
                "@sss/node-red-sss-joinmatrix/joinmatrix:join.errors.invalid-rename"
              );
          }

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 September 2022 09:53 UTC](https://discourse.nodered.org/t/editable-list-validate-with-external-value/68335/2 "2022-09-28T09:53:46Z")

</div>

A node's html file has access to jQuery. So you can use `$('#elementid').value()` to get the current value of the input element.

---

<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:** [27 November 2022 09:54 UTC](https://discourse.nodered.org/t/editable-list-validate-with-external-value/68335/3 "2022-11-27T09:54:19Z")

</div>

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