Members Login



Chronoforms Book

The ChronoForms Book, written for ChronoForms v3 contains 350 pages of invaluable ChronoForms How-tos hints and tips.

Note: many of the ideas can be used in ChronoForms v4 but the admin interface is very differetn and code examples may need to be modified.

Advanced Chronoforms

To help some of you getting started, I've posted below text file containing the complete configuration of a form.

It also has a few nice addons:

  • Form check for required fields
  • Show image verification only to visitors, not registered users
  • Add dynamic email addresses and a dynamic subject
  • Template to send the email

Everything is commented, so make sure to read the comments (especially in the Form HTML).

Enjoy
Notexa

ChronoForms Configuration

Written and designed by Robby Timmermans, Notexa bvba
Version 1.2
This document may be distributed

Change History:
  • Added a closing tag in the email template
  • Translation to English

General

Form Name: checkincheckout
Email the results ? Yes
Email Address(es): your emailaddress(es) // Static emailaddress(es), dynamic (form) address(es) can be added in the next tab
Email Subject: Your subject // Default subject, can be changed to a dynamic (form) subject in the next tab
Form tag attachment: onsubmit='return checkform();' // Call the checkform javascript function when the form is submitted
From Email: admin@example.com // default from email
From Name: Web Admin // default from name  
ReplyTo email: fadmin@example.com // default replyto email
In which format to send the results email: My Template

Special Fields

Email field: fromemail // form field, the dynamic emailadress(es) will be added to the static emailaddress(es)
Subject field: inout // form field, leave empty if you want to use the default subject
From email field: fromemail // form field, defines the sender email
From name field: fromname // form field, defines the sender name

Form Code

Form HTML

this is the code that will be shown as a form

<?php
global $my,$mosConfig_live_site;
// first we check if the user is logged
// if so, then we fill out some fields and set them to read only
$readonl="";
$in="";
$out="";
if ($my->id) {
$out=" SELECTED";
$readonl=" readonly='readonly'";
} else {
$in=" SELECTED";
}
?>
<fieldset>
<legend>Your data</legend>
<label for="fromname">Name : </label>
<input type="text" name="fromname" id="fromname" tabindex="510" value="<?php echo $my->name?>"<?php echo $readonl?> /><br />
<label for="fromemail">Email : </label><input type="text" name="fromemail" id="fromemail" tabindex="511" value="<?php echo $my->email?>"<?php echo $readonl?> /> <br />
<label for="inout">Action : </label><select name="inout" id="inout" tabindex="512">
<option value="1"<?php echo $in ?>>Check in</option>
<option value="2">Check in visitor</option>
<option value="3"<?php echo $out ?>>Check out</option>
</select> <br />
<label for="futdate">Date : </label><input type="text" name="futdate" id="futdate" tabindex="513" value="dd/mm/yyyy" /> <br />
<i>Please type the date in the field above</i><br /><br />
<label for="details">Details : </label><textarea cols=40 rows=4 name="details" id="details" tabindex="514"></textarea><br />
</fieldset>
<fieldset>
<legend>Send</legend>
<!-- To use the following line, you have to change the chronoforms code as well, please see http://www.chronoengine.com/index.php?option=com_fireboard&Itemid=37&func=view&catid=2&id=912 -->
<!-- This line makes sure that only visitors see the image verification, not the registered members -->
<?php if(!$my->id){ ?>
{imageverification}
<?php } ?>
<input type="submit" value="Send" tabindex="515" /> <input type="reset" value="Start over" tabindex="516" /></fieldset>
<script language="javascript">
document.ChronoContact_checkincheckout.fromname.focus();
</script>
Form Javascript

// javascript that will be placed before the form

function checkform () {
if (document.ChronoContact_checkincheckout.fromname.value==""){
alert("Please typ your name");
document.ChronoContact_checkincheckout.fromname.focus();
return false;
}
if (document.ChronoContact_checkincheckout.fromemail.value==""){
alert("Please typ your email");
document.ChronoContact_checkincheckout.fromemail.focus();
return false;
}
return true;
}
Email Template
// template used to send the email
<html>
<head></head>
<body>
Dear,<br /><br />
<b>{inout}: {fromname}</b>, <br />
and this for the date: {futdate}<br />
Optional details: {details}<br /><br />
With kind regards,<br /><br />
{fromname}
<br /><br />
<font size=1><i>Mail sent from http://www.notexa.be</i></font>
</body>
</html>

Form URLs

Redirect URL: link to static content page

Element titles

// if you send the email as field titles, you can define the description of a field here

fromname=Name
fromemail=Email address

Validation tab

Only available in the latest version (2007-08-29). Don't use yet, since it contains a bug or two.


 

 

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com