Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    BUG in validate() Form when using a DateRangeItem

    Version v13.0p_2022-08-22

    a Validate() Form returns false allthough a user entered a valid date in the 'from' and the 'to' date and the to date is not before the from date:
    Example :

    isc.DynamicForm.create({
    ID: "form",
    width: 500,
    titleOrientation: "top",
    dataSource: "worldDS",
    items: [
    { name: "independence", editorType: "DateRangeItem", showTitle: false },
    { name: "searchButton", type: "ButtonItem", title: "Validate",
    click: function () {
    form.validate();
    }
    }
    ]
    });

    #2
    Hi paulwilhelm,

    I'm not sure this is a bug. I tested here and can see what you mean, but validate() is in order to save data.
    You can't save a date range into a type="date" field.

    But you are right, this reacts a bit funny IMHO with wrong dates combinations, so perhaps sth is off.
    Code:
    isc.DynamicForm.create({
        ID: "form",
        width: 500,
        titleOrientation: "top",
        dataSource: "worldDS",
        items: [{
                name: "independence",
                editorType: "DateRangeItem",
                showTitle: false
            },
            {
                name: "searchButton",
                type: "ButtonItem",
                title: "Validate",
                click: function() {
                    alert(isc.JSONEncoder.create().encode(form.getValuesAsAdvancedCriteria()));
                }
            }
        ]
    });
    Best regards
    Blama

    Comment


      #3
      Thanks for your answer. My Intention was a little bit easier. I only wanted to make sure that both date fields are filled with valid dates, because a fetch from the server only makes sense when this condition is fullfilled. It is a searchForm with some manadtory / required fields (not null, not empty).
      I redesigned it and now use two date fields.
      Kind regards
      Paul

      Comment

      Working...
      X