PDA

View Full Version : Newbie Getting Started



Al_M
06-Apr-2008, 04:41 PM
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

russellr
07-Apr-2008, 07:11 PM
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:


<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:


<if $Prod2Qty>
<p>
Product: $Prod2Desc, Quantity: $Prod2Qty
</p>
</if>
Similarly, to test for a zero value:


<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.

Al_M
08-Apr-2008, 03:12 AM
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?

russellr
08-Apr-2008, 03:56 AM
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.

Al_M
10-Apr-2008, 04:51 AM
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

aaron_w
09-May-2008, 12:23 AM
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:


<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:


<if $Prod2Qty>
<p>
Product: $Prod2Desc, Quantity: $Prod2Qty
</p>
</if>
Similarly, to test for a zero value:


<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,


<if $Prod2Qty > 0></if>

Thanks

aaron_w
09-May-2008, 12:29 AM
Are there any other operators supported for these? For example,


<if $Prod2Qty > 0></if>

Thanks

Well obviously that one would confuse HTML :)

I guess it would have to be


<if $Prod2Qty gt 0></if>

or something like that :)

russellr
09-May-2008, 02:24 AM
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.