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: This email address is being protected from spam bots, you need Javascript enabled to view it // default from email
From Name: Web Admin // default from name  
ReplyTo email: f This email address is being protected from spam bots, you need Javascript enabled to view it // 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.


Return to the Tutorials page

 

equalheight If you have any questions you can post to our forums and we will be glad to help ASAP

Members Login






Lost Password?
No account yet? Register

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

ChronoForms License

equalheightTo be able to continue working at this component we decided to get a small profit out of it but at the same time don't force everybody to pay in order to use this great component.

 

 From version 1.5 and up a link at the bottom of everyform created will be placed, saying "joomla professional work", the link will be to us here htttp://www.chronoengine.com, its illegal to remove this link from the source code unless you have a license,

so the license is very simply for the same ChronoForms component without a link, thats all!

This License is for 5 different websites ONLY. 

 

 However, in order to allow everybody to still use the component and even get out of this, the link is inside a div with class : chronoform , use this to hide the link by using different colors or whatever if you really can't pay, but of course the link is still exists at your page source.

 

The license is ONLY 25$ can be bought here :

 

Thank you!

 

ChronoEngine.com Team 

Joomla Templates and Joomla Tutorials