chrismheiser / lipdnet

All things related to Lipd.net and the LiPD Playground
http://www.lipd.net
1 stars 1 forks source link

Prohibit commas and other special characters in the data entry fields #104

Open nickmckay opened 2 years ago

nickmckay commented 2 years ago

Would that be possible?

chrismheiser commented 2 years ago

According to their docs "transform" function, I think it should be possible to "clean" the input on entry. Commas might be a little trickier since those are sometimes the delimiter, but special characters should be good.

https://www.papaparse.com/docs#config

"transform | A function to apply on each value. The function receives the value as its first argument and the column number or header name when enabled as its second argument. The return value of the function will replace the value it received. The transform function is applied before dynamicTyping. "

nickmckay commented 2 years ago

Yeah, this seems like a good solution. Commas are among the most important, since that often causes problems later after the data are put into csv files, so hopefully we can find a transform that removes them too. (or replaces them with semicolons or something else.)