Webform Option Limit: How to change the number to subtract from the limit

Created on 23 August 2023, over 1 year ago
Updated 4 May 2024, 7 months ago

Problem/Motivation

I've used the option limit handler before without problems, but now I have a new scenario.
I have a limit of 200 seats and each user can reserve up to a maximum of 5 seats. The user chooses the number of seats from the element seats_number(of type number).

Steps to reproduce

Example: 200 seat limit, user selects 4 seats, new limit is 200-4=196.

What should I change in the settings handlers?

Thank you so much for help me.

Feature request
Status

Closed: won't fix

Version

6.1

Component

Code

Created by

🇮🇹Italy kris77

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kris77
  • Status changed to Closed: won't fix over 1 year ago
  • 🇺🇸United States jrockowitz Brooklyn, NY

    This will require a similar solution to the options limits handler but built via custom code or dedicated contribs module.

  • 🇮🇹Italy kris77

    Thank you so much for reply @jrockowitz, but can this be considered as a new feature?

    In the option limit settings, the possibility of selecting a numeric type field which establishes the value to be subtracted from the limit.

  • Status changed to Active about 1 year ago
  • Status changed to Postponed: needs info about 1 year ago
  • I think the community may be interested in reviewing your suggested feature code. Open a merge request and we will have a look.

  • 🇮🇹Italy kris77

    Thanks @cilefen. As soon as I have the code I will open a merge request.

    I'm not an experienced programmer, so I'll take some time.

    Thanks again.

  • Status changed to Closed: won't fix about 1 year ago
  • 🇺🇸United States jrockowitz Brooklyn, NY

    We are holding off adding new features to the webform. Please post a recipe or dedicated contribs module.

  • 🇨🇦Canada mmaranao Calgary, AB

    I ran into needing this feature as well and wrote a patch to include numeric fields to be included in the configuration. The sum of all the numeric input fields is subtracted from the limit to get the remaining. Hope this helps!

Production build 0.71.5 2024