Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-2704

Add HTML element option to disable only certain fields on form submission

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.3.0-b1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      CORE-2546 added the ability to disable submit buttons on form submission.

      This task aims to add an option to configure which fields can be disabled by allowing a class to be defined and checked.

      Consider:

      <form class="disable-on-submit" data-disable-on-submit="disable_me">
          <input type="text" name="test" value="Test" />
          <input type="button" name="button" value="Press Me" class="disable_me" />
          <input type="submit" name="process" value="Process" />
          <button type="submit" name="submit" value="Submit" class="disable_me" />
      </form>
      

      In the above HTML, the "disable-on-submit" form class will disable all submit buttons by default upon submission. We will further limit this by:

      1. Allowing the form to set a "data-disable-on-submit" value which contains the name of a class, which can be any string that does not begin with a period (.) or pound (#) symbol.
      2. When a class is set in that data-disable-on-submit attribute, only fields within the form that set that class should be disabled.
        • For example, the above code defines the class "disable_me". Only the fields within the form that contain the class "disable_me" should actually be disabled. All other fields should not be disabled.

        Issue Links

          Activity

          tyson Tyson Phillips (Inactive) created issue -
          tyson Tyson Phillips (Inactive) made changes -
          Field Original Value New Value
          Link This issue relates to CORE-2546 [ CORE-2546 ]
          tyson Tyson Phillips (Inactive) made changes -
          Description CORE-2546 added the ability to disable submit buttons on form submission.

          This task aims to add an option to configure which fields can be disabled by allowing a class to be defined and checked.

          Consider:
          {code:html}
          <form class="disable-on-submit" data-disable-on-submit="disable_me">
              <input type="text" name="test" value="Test" />
              <input type="button" name="button" value="Press Me" class="disable_me" />
              <input type="submit" name="process" value="Process" />
              <button type="submit" name="submit" value="Submit" class="disable_me" />
          </form>
          {code}
          #* The above example, when submitted, will then add a new attribute "disabled='disabled'":
          {code:html}
          <form class="disable-on-submit" data-disable-on-submit="disable_me">
              <input type="text" name="test" value="Test" />
              <input type="button" name="button" value="Press Me" class="disable_me" disabled="disabled" />
              <input type="submit" name="process" value="Process" />
              <button type="submit" name="submit" value="Submit" class="disable_me" disabled="disabled" />
          </form>
          {code}

          In the above HTML, the "disable-on-submit" form class will disable all submit buttons by default upon submission. We will further limit this by:
          # Allowing the form to set a "data-disable-on-submit" value which contains the name of a class, which can be any string that does not begin with a period (.) or pound (#) symbol.
          # When a class is set, *only fields within the form that set that class should be disabled*.
          #* For example, the above code defines the class "disable_me". Only the fields within the form that contain the class "disable_me" should actually be disabled. All other fields should not be disabled.
          CORE-2546 added the ability to disable submit buttons on form submission.

          This task aims to add an option to configure which fields can be disabled by allowing a class to be defined and checked.

          Consider:
          {code:html}
          <form class="disable-on-submit" data-disable-on-submit="disable_me">
              <input type="text" name="test" value="Test" />
              <input type="button" name="button" value="Press Me" class="disable_me" />
              <input type="submit" name="process" value="Process" />
              <button type="submit" name="submit" value="Submit" class="disable_me" />
          </form>
          {code}

          In the above HTML, the "disable-on-submit" form class will disable all submit buttons by default upon submission. We will further limit this by:
          # Allowing the form to set a "data-disable-on-submit" value which contains the name of a class, which can be any string that does not begin with a period (.) or pound (#) symbol.
          # When a class is set in that data-disable-on-submit attribute, *only fields within the form that set that class should be disabled*.
          #* For example, the above code defines the class "disable_me". Only the fields within the form that contain the class "disable_me" should actually be disabled. All other fields should not be disabled.
          tyson Tyson Phillips (Inactive) made changes -
          Story Points 3
          tyson Tyson Phillips (Inactive) made changes -
          Rank Ranked higher

            People

            • Assignee:
              Unassigned
              Reporter:
              tyson Tyson Phillips (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: