Results 1 to 5 of 5

Thread: Condition to exclude characters?

  1. #1
    Join Date
    Mar 2006
    Posts
    17

    Default Condition to exclude characters?

    Hi - we're having a problem with users entering semi-colons and line feeds in text boxes which is resulting in invalid CSV files being produced. Is it possible to use conditions to stop certain characters being entered in the text boxes or is there a better way to do this? Thanks.

  2. #2
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Condition to exclude characters?

    formmail has ways of configuring CSV settings so that these chars should be OK: http://www.tectite.com/fmdoc/csv_file_settings.php

    if that doesn't work, the problem is probly with the program ur trying to read the CSV files with

    u can control what gets put in a CSV file column with some special control settings, documented here: http://www.tectite.com/fmdoc/creatin...php#csvcolumns

    try that....if u still need a condition, post back

  3. #3
    Join Date
    Mar 2006
    Posts
    17

    Default Re: Condition to exclude characters?

    Hi thanks for reply, much appreciated. The problem is that a semi-colon is used as the field delimiter in the CSV file and if a user has typed a semi-colon in one of the text box fileds then the CSV file fields are out of alignment. Also if they put in a line break, then that also messes it up, so hence the need to strip these characters before the CSV is produced.

  4. #4
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Condition to exclude characters?

    the quoting around each column should fix that, but it depends on the intelligence of the program reading the CSV file.

    so, a condition to detect seimcolons:
    HTML Code:
    <input type="hidden" name="conditions" value=":@
      @TEST@fld !~ /;/@do not enter seimcolons@" />
    and semicolons and line breaks:

    HTML Code:
    <input type="hidden" name="conditions" value=":@
      @TEST@fld !~ /[;\r\n]/@do not enter seimcolons or line breaks@" />
    tho its pobly best to just strip the line breaks like it mentions in the doco i pointed u to in my previous post

  5. #5
    Join Date
    Mar 2006
    Posts
    17

    Default Re: Condition to exclude characters?

    That's great - thank you very much for helping me out, much appreciated.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. weird characters in mail
    By Jackal in forum FormMail Subscription Support
    Replies: 0
    Last Post: 29-Sep-2005, 05:41 AM
  2. Condition - restrict maximum checkboxes
    By tvulucy in forum FormMail Subscription Support
    Replies: 3
    Last Post: 22-Aug-2005, 08:42 PM
  3. Special Characters in Value String
    By hpinson in forum FormMail Subscription Support
    Replies: 4
    Last Post: 24-Mar-2005, 09:04 PM
  4. Exclude Option
    By zeuseason in forum FormMail Subscription Support
    Replies: 2
    Last Post: 16-Sep-2004, 08:32 PM
  5. using Exclude
    By moreview in forum FormMail Subscription Support
    Replies: 5
    Last Post: 28-May-2004, 01:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •