Results 1 to 8 of 8

Thread: Newbie Getting Started

  1. #1
    Join Date
    Mar 2008
    Posts
    6

    Default Newbie Getting Started

    Purchased Captcha and CM a few days ago. Got Captcha working on my forms and now looking for information on getting started with Computational Module. The welcome email says just upload to server. Then I found that I needed to make "ADVANCED_TEMPLATES",true - done.

    Now I need to create a simple IF, THEN, ELSE condition that checks the value of a radio select that directs the user to the next_page.

    Can you point me to a user guide where I can see what commands/syntax are available using this module. Or are there any examples posted that I can disect?

    Your assistance is appreciated...al

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

    Default Re: Newbie Getting Started

    Hi,

    For Advanced Templates, you can use "if" statements as follows....

    Suppose you have a name field for a second, optional, person. You can do this:
    HTML Code:
    <if "$Name2">
      <p>
         The second person is $Name2
      </p>
    </if>
    <if ! "$Name2">
      <p>
         There was no second person specified.
      </p>
    </if>
    The "!" means "not" and inverts the condition

    For numeric fields, you can test for zero or non-zero. Suppose you're dealing with a product quantity:
    HTML Code:
    <if $Prod2Qty>
      <p>
         Product: $Prod2Desc, Quantity: $Prod2Qty
      </p>
    </if>
    Similarly, to test for a zero value:
    HTML Code:
     <if ! $Prod2Qty>
       <p>
          A second product was not ordered.
      </p>
     </if>
    That should get you started. Let me know if you have a specific example you need help with.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Mar 2008
    Posts
    6

    Default Re: Newbie Getting Started

    Thanks for the info. Forgive my ignorance. Can you tell me where in the my html form I would place an example like this?

    Also, how can I check the value of a field?
    Last edited by Al_M; 08-Apr-2008 at 03:02 AM.

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

    Default Re: Newbie Getting Started

    Hi,

    These instructions can go in any FormMail template you use.

    Templates are:
    • form results, such as mail_options HTMLTemplate
    • the second and following pages of a multi-page form
    • good_template, and bad_template.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #5
    Join Date
    Mar 2008
    Posts
    6

    Thumbs up Re: Newbie Getting Started

    Russell

    That works for me! Thought I was going to have to have a good/email template for every combination - what a scarry thought.

    The samples make sense once knowing where & how to use them. It helped me create a single HTMLtemplate and good_template that reports all the data entered for up to 4 drivers and vehicles.

    Kudos to you for such a great product. Many Thanks!

    Next task is securing with ini file.

    Al

  6. #6
    Join Date
    Apr 2008
    Posts
    23

    Default Re: Newbie Getting Started

    Quote Originally Posted by russellr View Post
    Hi,

    For Advanced Templates, you can use "if" statements as follows....

    Suppose you have a name field for a second, optional, person. You can do this:
    HTML Code:
    <if "$Name2">
      <p>
         The second person is $Name2
      </p>
    </if>
    <if ! "$Name2">
      <p>
         There was no second person specified.
      </p>
    </if>
    The "!" means "not" and inverts the condition

    For numeric fields, you can test for zero or non-zero. Suppose you're dealing with a product quantity:
    HTML Code:
    <if $Prod2Qty>
      <p>
         Product: $Prod2Desc, Quantity: $Prod2Qty
      </p>
    </if>
    Similarly, to test for a zero value:
    HTML Code:
     <if ! $Prod2Qty>
       <p>
          A second product was not ordered.
      </p>
     </if>
    That should get you started. Let me know if you have a specific example you need help with.
    Are there any other operators supported for these? For example,

    HTML Code:
    <if $Prod2Qty > 0></if>
    Thanks

  7. #7
    Join Date
    Apr 2008
    Posts
    23

    Default Re: Newbie Getting Started

    Quote Originally Posted by aaron_w View Post
    Are there any other operators supported for these? For example,

    HTML Code:
    <if $Prod2Qty > 0></if>
    Thanks
    Well obviously that one would confuse HTML

    I guess it would have to be

    HTML Code:
    <if $Prod2Qty gt 0></if>
    or something like that

  8. #8
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Newbie Getting Started

    Hi,

    No, currently the Advanced Templates only test for empty or not empty (for strings) or zero or not zero (for numbers).

    The plan is to add some sort of expression syntax in the "if" tags.

    So, the solution is to use the Computation Module to compute the if tests you want, and generate (export) an empty or non-empty field to signify the test.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. form mail newbie
    By akt in forum FormMail Subscription Support
    Replies: 3
    Last Post: 07-Mar-2005, 11:09 PM
  2. Newbie question on open_basedir error
    By zenprofit in forum FormMail Subscription Support
    Replies: 14
    Last Post: 14-Feb-2005, 09:35 PM
  3. newbie problem
    By istory in forum FormMail Subscription Support
    Replies: 3
    Last Post: 03-Dec-2004, 08:34 AM
  4. Newbie please help no recipents error
    By Mikej in forum FormMail Subscription Support
    Replies: 3
    Last Post: 23-Apr-2004, 05:55 AM
  5. Newbie: Help for the .php challenged
    By jeanie in forum FormMail Subscription Support
    Replies: 7
    Last Post: 29-Mar-2004, 08:49 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
  •