+ Reply to Thread
Results 1 to 4 of 4

Thread: Condition - restrict maximum checkboxes

  1. #1
    Join Date
    Oct 2004
    Posts
    27

    Default Condition - restrict maximum checkboxes

    Morning.

    I have a report request form with 10 checkboxes for different reports, but the user is only allowed to request a maximum of 3

    Can I create a condition that checks to see whether they have selected more than 3 reports, or will I need to add some javascript for this?

    Thanks
    Lucy

  2. #2
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Condition - restrict maximum checkboxes

    Hi,

    JavaScript will be more straightforward, but, of course, only works if JS is enabled in the user's browser.

    To do this just in FormMail, I recommend the following:
    1. Each checkbox has a value of '1', say
    2. You use "derive_fields" to derive a field which is the concatenation of all the checkbox fields:
      Code:
      name="derive_fields" value="TestCheck=fld1.fld2.fld3.fld4...."
    3. You use a condition to check that the "TestCheck" field is no more than three 1's:
      Code:
      @TEST@TestCheck~1{1,3}@You must select no more than 3 reports@
    Something like that, anyway.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Oct 2004
    Posts
    27

    Default Re: Condition - restrict maximum checkboxes

    Hi

    Not having much luck with this I'm afraid - I'm getting:
    Warning: Delimiter must not be alphanumeric or backslash in /tvu-env/virtualhosts/tvu.boxnewmedia.com/doc-root/formmail.php on line 3562
    Text file of the code I'm using is attached (you'll need to add a recipient)

    Thanks for your help
    Lucy
    Attached Files

  4. #4
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: Condition - restrict maximum checkboxes

    Hi,

    You've got the delimiters around the wrong way. You want "#:" not ":#".

    The internal delimiter comes first.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. something not working, checkboxes
    By ScottR in forum Community Support
    Replies: 1
    Last Post: 13-Feb-2006, 10:22 PM
  2. Email Condition doesnt work
    By milez in forum FormMail Subscription Support
    Replies: 1
    Last Post: 14-Nov-2005, 06:06 PM
  3. Maximum length of CSV file
    By eu4ic in forum FormMail Subscription Support
    Replies: 3
    Last Post: 14-Aug-2005, 01:34 PM
  4. new code for multiple checkboxes
    By nevdev in forum FormMail Subscription Support
    Replies: 2
    Last Post: 15-Jan-2005, 11:39 PM
  5. Checkboxes in JavaScript in conjunction with Formmail
    By Lesjo in forum FormMail Subscription Support
    Replies: 4
    Last Post: 15-Dec-2004, 11:46 PM

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