Score:0

Case-insensitive ignoreCase - text field

sa flag

i am trying to create a text field that accepts case-insensitive text but be unique.

Hassan is hAssan is haSsan...etc

i have tried a different combinations of regex with no success. i would be thankful if someone could help out with this.

where can i suggest if J could add a toggle switch (ignoreCase on/off)?

enter image description here

enter image description here

enter image description here

leymannx avatar
ne flag
Unique to what? Unique to all existing submissions? Then you need custom element validation querying the database for all existing submissions.
Hassan Alsheikh avatar
sa flag
webform has a toggle unique to the text field... so it is a unique entry for that field. this is how it works (i guess)... so if i created a text field called email and switched the unique toggle on it should check for the entries of that field... in the current state of things... hassan@blahblah unique... and if i enter Hassan@blahblah it would see it as a different value.
leymannx avatar
ne flag
Wow, TIL that Webform indeed has this built-in already: https://git.drupalcode.org/project/webform/-/blob/6.1.x/src/Plugin/WebformElementBase.php#L1976-2056. I see that you disabled all the unique checkboxes. Please try to have only the "Unique" one selected and the other ones disabled. If this still doesn't work, try to remove the pattern as well.
leymannx avatar
ne flag
If it's case insensitive you should file a feature request issue on https://www.drupal.org/project/issues/webform.
Hassan Alsheikh avatar
sa flag
thanks a ton leymannx... i have tried all the combinations... i just didn't upload the screen shots... i filed a bug / feature request. the only thing i did not test is email uniqueness... i don't know if webform has a specific email field... I'm sure [email protected] and [email protected] are the same. so the case sensitivity or insensitivity is something that webform has already ...
id flag
I’m voting to close this question because it is a bug report on the module.
Hassan Alsheikh avatar
sa flag
i agree... i filed a bug and jrock responded that "This might not be fixable because some SQL engines have case-insensitive queries." i'll do some digging and lets see if gpt-4 can propose something... do i close this thread ? or someone had to do it .?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.