user inserted commas causing problems...

User 506998 Photo


Registered User
164 posts

Got to be a simple solution to this. The commas that users insert into text fields (even if I tell them not to) are causing problems with a database reading the .csv file. The internal commas are jumping the data into succeeding table blocks. Is there a way to disable commas or the reading of commas by the form? Or am I missing something.....?
User 506998 Photo


Registered User
164 posts

I notice that text fields create quoted text in the .csv whereas text areas do not. It's in the text areas where commas are occasionally inserted and throwing off the .csv results. I haven't tested commas in the text fields. So is this my problem? Do I need to change (fortunately there's only 2 and they don't have to be longer than a single line) the text areas to text fields? But finally... if this is the problem, why do the text areas not create quoted text in the .csv ?
User 506998 Photo


Registered User
164 posts

Nope.. the text fields that have user inputted commas are glitching my .csv table output as well.
User 506998 Photo


Registered User
164 posts

I'm not using Excel... my client does, but for testing, I use OpenOffice.org Base. It behaves just like Excel. And the .csv file opens fine in it. I don't understand how it is able to ignore certain commas and obey others, but it seems to do it correctly enough. What I'm having a problem with is a 3rd party web php solution that will display the .csv in tables and allow you to edit all on line. And it it this application that can't differentiate the commas. So I know you aren't providing support for them :lol: but the solution does lie in the commas that Form Builder allows in the text fields and areas.
Wait a minute... Does Form Builder automatically create the quotes if a comma is found within the text?
That would explain how OpenOffice reads it and then the problem is probably that my php display app doesn't recognize the quotes because they are showing up in the tables it presents online.
User 187934 Photo


Senior Advisor
20,266 posts
Online Now

I just went a round with commas and some regular expressions.:lol: Yes they can cause issues. The best thing to do is to write your script to handle them before you process the csv.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 506998 Photo


Registered User
164 posts

Hey... yup... I would have deleted my earlier thought process, but waited too late. :D
I'm in touch with the developer of the code, but its a free extension offered with another company, and with limited support. It's really nice (except for the comma handling) as it lets me view a .csv (created in CCWFB) on a webpage in a table all laid out nicely with the labels.... fonts and colors selectable... padding... number of entries per page, etc. Then it also lets you examine a single user form entry and then even edit that entry, all online. I've found in their php where they set the $separator = ","; but there is no $enclosure = '"'; and I'm not sure of the syntax even. I'm working more or less trial and error - often it gets me there. If anyone is interested in tweaking the code, be my guest :lol: ...
If I can get it to work it will be sweet....
User 187934 Photo


Senior Advisor
20,266 posts
Online Now

Stack overflow is one of the best resources for getting help. Take a look at this post as it has the basic setup for what your looking for as far as handling the commas.
http://stackoverflow.com/questions/6536 … mas-in-csv
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 10077 Photo


Senior Advisor
1,096 posts

You could rethink your solution process. Right now you are writing to csv which is rather limited. However, if you save data to MySQL, you can then write a routine that would format everything exactly as you want it and remove any offending commas (or other code for that matter) very easily.
ASK ME ANYTHING
I provide personalized help for Coffeecup Users including personal or group training for Site Designer, Web Form Builder and more via Zoom.
Email me at support@uscni.org or call 865-687-7698.

Did you know that Web Form Builder can be used for both simple and complicated forms and that it's not limited to the default fonts and buttons? Take a look at a form we developed for WindowTinting.com.
https://forms.windowtinting.com/forms/w … ppingcart/
User 506998 Photo


Registered User
164 posts

Thanks guys. I'm not a programmer, I'm a designer, so I need to stay with what I know. I've created a MySQL db before, so I'll explore that a tad more. Google Docs will actually do the trick, and I may be able to have Google read directly from the location of the CC generated .csv file.
One last thing...:lol:
Is there simple code modification for CCFB (and I would need to know the code and where to put it) that will put quotes around all fields automatically?
Cheers
User 187934 Photo


Senior Advisor
20,266 posts
Online Now

There's no way to do this directly through the form builder and would require a significant alteration of the code. I really need to ask why you need the quotes on there? It would be easier to add them in your display output after the data has been posted.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.