kartevonmorgen / kartevonmorgen.ts

Mapping-Frontend to find and add sustainable Organisations (Initiatives, Companies) and Events on Kartevonmorgen.org / MapofTomorrow.org
https://kartevonmorgen.org/
GNU General Public License v3.0
11 stars 13 forks source link

entryform: Give warning if mail or website contains spacings #138

Closed wellemut closed 1 year ago

wellemut commented 2 years ago

Problem

One of the most common errors is, that user write additional word/explanation in the field of email or website

Solution

Show the field text in red, as long as it contains spaces or strange sings...


This is needed independently how far the backend can trim wrong content: Related to: https://github.com/kartevonmorgen/openfairdb/issues/393

navid-kalaei commented 2 years ago

for the email validation I use the isemail package. and before passing the values I trim the strings which means removing spaces from the beginning and the end of the email then checking for the validations. should i keep the extra spaces before passing the string to the validation function? or for better understanding could you please comment more test cases that what templates should pass and which ones should fail?

here is the reference for isemail email validation of entries email validation of events

wellemut commented 2 years ago

I think you should take whatever the users entered and pass it to the validation.

Because if somebody writes

Private user@server.org Wien And you test in isemail Privateuser@server.orgWien Than you don't get an error although it's stupid.

Ich think better just visually indicate a problem. If possible you can also add explainations under the field. I e.: No spaces allowed

wellemut commented 1 year ago

Frontend trims spacing form mail and website automatically