" name="email" >  Naam {firstname} {middlename} {lastname} Adres {address} Postcode {zipcode} Plaats {city} email email;?> Adres {address} Postcode {zipcode} Plaats {city} Logboeknummer {cb_logboeknummer} Verloopdatum medische keuring {cb_verloopdatummedischekeruring}  Ik heb de voorwaarden gelezen en accepteer deze. Gelezen De bovenstaande gegevens en mijn pasfoto heb ik gecontroleerd en zijn compleet en correct. Indien dit niet het geval is, dan eerst deze gegevens in uw profiel wijzigen. Onvolledige aanvragen worden niet geaccepteerd accoord AantalPrijs per pas1-19€ 90,0020-49€ 82,50> 50€ 75,00 De kosten zullen door de penningmeester dmv automatische incasso geind worden. Voor instructeurs, die lesgeven aan de Bosmolenplas, wordt het pasje vergoed door de vereniging.Type hier de zwarte karakters in het veld{imageverification}  "> CB fields and validation - Forums

Forums

CB fields and validation

pdenessen 08 Feb, 2009
Hi,

I am setting up a form, where registered users can order a Pas.
For this they have to log in the site and go to the specific form. In this form some known info is being retrieved from the CB tabel (comprofiler).
The user has to check these infromations and after confirming he can push on the submit button.
This is all working fine🙂

I want to build in a check, that all fields are filled in before he can hit the submit button.
Further I want to check if he has a valid avatar and not the "no_photo" picture. This picture file should then also be added to the email.

Her is my code of the form so far :

<DIV STYLE="background-color: white;">
<DIV class="form_item">
<DIV class="form_element cf_text" ><SPAN class="cf_text" >Aanmelding Bosmolenplaspas 2009/2010</SPAN></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item">
<DIV class="form_element cf_checkbox">
<LABEL class="cf_label">Ik had nog geen Bosmolenplaspas</LABEL><INPUT class="radio" id="nieuw"  type="checkbox" value="ja" name="nieuw" />  </INPUT></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV>
<img src="/site/images/comprofiler/{avatar}" alt="foto" /></DIV>
</BR>

<DIV class="form_element cf_hidden">
<INPUT id="voornaam" type="hidden"  value="{firstname}" name="voornaam" ></INPUT>
<INPUT id="tussennaam"  type="hidden" value="{middlename}" name="tussennaam"></INPUT>
<INPUT id="achternaam"  type="hidden" value="{lastname}" name="achternaam"></INPUT>
<INPUT id="adres"  type="hidden" value="{address}" name="adres"></INPUT>
<INPUT id="postcode" type="hidden" value="{zipcode}" name="postcode" ></INPUT>
<INPUT id="plaats"  type="hidden" value="{city}" name="plaats"></INPUT>
<INPUT id="email"  type="hidden" value="<?php $user = &JFactory::getUser(); echo $user->email;?>" name="email" ></INPUT>
<INPUT id="logboeknummer"  type="hidden" value="{cb_logboeknummer}" name="logboeknummer"></INPUT>
<INPUT id="medische_keuring" type="hidden" value="{cb_verloopdatummedischekeruring}" name="medische_keuring"></INPUT>
<DIV class="clear" > </DIV>
</DIV>


<table border="0" cellspacing="2" cellpadding="4">
  <tr>
    <td>Naam</td>
    <td>{firstname} {middlename} {lastname}</td>
  </tr>
  <tr>
    <td>Adres</td>
    <td>{address}</td>
  </tr>
 <tr>
    <td>Postcode</td>
    <td>{zipcode}</td>
  </tr>
 <tr>
    <td>Plaats</td>
    <td>{city}</td>
  </tr>
 <tr>
    <td>email</td>
    <td><?php echo $user->email;?></td>
  </tr>
 <tr>
    <td>Adres</td>
    <td>{address}</td>
  </tr>
 <tr>
    <td>Postcode</td>
    <td>{zipcode}</td>
  </tr>
 <tr>
    <td>Plaats</td>
    <td>{city}</td>
  </tr>
 <tr>
    <td>Logboeknummer</td>
    <td>{cb_logboeknummer}</td>
  </tr>
 <tr>
    <td>Verloopdatum medische keuring</td>
    <td>{cb_verloopdatummedischekeruring}</td>
  </tr>
</table>
<DIV class="clear" > </DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_checkbox"><LABEL class="cf_label">Ik heb de voorwaarden gelezen en accepteer deze.</LABEL><INPUT class="radio validate-one-required" id="gelezen"  type="checkbox" value="1" name="gelezen" />  <label class="check_label" for="label" >Gelezen</label>
</DIV>
</DIV>
<DIV class="clear" > </DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_checkbox"><LABEL class="cf_label">De bovenstaande gegevens en mijn pasfoto heb ik gecontroleerd en zijn compleet en correct. Indien dit niet het geval is, dan eerst deze gegevens in uw profiel wijzigen. Onvolledige aanvragen worden niet geaccepteerd</LABEL><INPUT class="radio validate-one-required" id="accoord"  type="checkbox" value="1" name="accoord" />  <label class="check_label" for="label" >accoord</label></DIV>
</DIV>
<DIV class="clear" > </DIV>

<DIV class="form_item">
<table style="height: 84px;" border="0" cellspacing="2" cellpadding="2" width="220">
<tr>
<td align="center">Aantal</td>
<td align="center">Prijs per pas</td>
</tr>
<tr>
<td align="center">1-19</td>
<td align="center">€ 90,00</td>
</tr>
<tr>
<td align="center">20-49</td>
<td align="center">€ 82,50</td>
</tr>
<tr>
<td align="center">> 50</td>
<td align="center">€ 75,00</td>
</tr>
</table></DIV>
<DIV class="clear" > </DIV>

<DIV class="form_item">De kosten zullen door de penningmeester dmv automatische incasso geind worden. <br /><br />
Voor instructeurs, die lesgeven aan de Bosmolenplas, wordt het pasje vergoed door de vereniging.<br /><br />
</DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_captcha" ><LABEL class=cf_label >Type hier de zwarte karakters in het veld</LABEL><SPAN >{imageverification}</SPAN></DIV>
</DIV>
<DIV class=clear > </DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_button" ><INPUT value="Versturen" name="undefined" type="submit"></DIV>
</DIV>
<DIV class="clear" > </DIV>

</DIV>


Max_admin 08 Feb, 2009
Hi pdenessen,

for this you need some JS code for your form, and for the photo one, you need a piece of PHP + a piece of JS, all depends on your form code and fields names.

for the first one though, you may use the built in validation of Chronoforms, look at the validation tab and the tooltips there and our faqs here to see how you can use it, its so easy!

regards
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
pdenessen 10 Feb, 2009
Hi Max,

I tried to use the Mootools validation as you suggested, but it does not work.

This is what I did :
On the tab validation:
- enable validation
- select mootools library (there is only one)
- filled in : logboeknummer,medische_keuring in the "1- required - not blank) field
logboeknummer and medische keuring are defined in the form code (see above)

I also tried the "Form JavaScript" field as you suggested :

function validate_required(field,alerttxt)
{
with (field)
{
  if (value==null||value=="")
  {
  alert(alerttxt);return false;
  }
  else
  {
  return true;
  }
}
}

function validate_form(thisform)
{
with (thisform)
{
if (validate_required(email,"Email must be filled out!")==false)
  {email.focus();return false;}
}
}



but I do not know what to enter in the "On Submit code - before sending email" field
Max_admin 10 Feb, 2009
can I see the form somewhere online ? may be you have a JS conflict!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
pdenessen 11 Feb, 2009
Sure here it is:

<DIV STYLE="background-color: white;">
<DIV class="form_item">
<DIV class="form_element cf_text" ><SPAN class="cf_text" >Aanmelding Bosmolenplaspas 2009/2010</SPAN></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item">
<DIV class="form_element cf_checkbox">
<LABEL class="cf_label">Ik had nog geen Bosmolenplaspas</LABEL><INPUT class="radio" id="nieuw"  type="checkbox" value="ja" name="nieuw" />  </INPUT></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV>
<img src="/site/images/comprofiler/{avatar}" alt="foto" /></DIV>
</BR>

<DIV class="form_element cf_hidden">
<INPUT id="voornaam" type="hidden"  value="{firstname}" name="voornaam" ></INPUT>
<INPUT id="tussennaam"  type="hidden" value="{middlename}" name="tussennaam"></INPUT>
<INPUT id="achternaam"  type="hidden" value="{lastname}" name="achternaam"></INPUT>
<INPUT id="adres"  type="hidden" value="{address}" name="adres"></INPUT>
<INPUT id="postcode" type="hidden" value="{zipcode}" name="postcode" ></INPUT>
<INPUT id="plaats"  type="hidden" value="{city}" name="plaats"></INPUT>
<INPUT id="email"  type="hidden" value="<?php $user = &JFactory::getUser(); echo $user->email;?>" name="email" ></INPUT>
<INPUT id="brevet"  type="hidden" value="{cb_brevet}" name="brevet"></INPUT>
<INPUT id="logboeknummer"  type="hidden" value="{cb_logboeknummer}" name="logboeknummer"></INPUT>
<INPUT id="medische_keuring" type="hidden" value="{cb_verloopdatummedischekeruring}" name="medische_keuring"></INPUT>
<DIV class="clear" > </DIV>
</DIV>


<table border="0" cellspacing="2" cellpadding="4">
  <tr>
    <td>Naam</td>
    <td>{firstname} {middlename} {lastname}</td>
  </tr>
  <tr>
    <td>Adres</td>
    <td>{address}</td>
  </tr>
 <tr>
    <td>Postcode</td>
    <td>{zipcode}</td>
  </tr>
 <tr>
    <td>Plaats</td>
    <td>{city}</td>
  </tr>
 <tr>
    <td>email</td>
    <td><?php echo $user->email;?></td>
  </tr>
 <tr>
    <td>Adres</td>
    <td>{address}</td>
  </tr>
 <tr>
    <td>Postcode</td>
    <td>{zipcode}</td>
  </tr>
 <tr>
    <td>Plaats</td>
    <td>{city}</td>
  </tr>
 <tr>
    <td>Logboeknummer</td>
    <td>{cb_logboeknummer}</td>
  </tr>
 <tr>
    <td>Brevet</td>
    <td>{cb_brevet}</td>
  </tr>
 <tr>
    <td>Verloopdatum medische keuring</td>
    <td>{cb_verloopdatummedischekeruring}</td>
  </tr>
</table>
<DIV class="clear" > </DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_checkbox"><LABEL class="cf_label">Ik heb de voorwaarden gelezen en accepteer deze.</LABEL><INPUT class="radio validate-one-required" id="gelezen"  type="checkbox" value="1" name="gelezen" />  <label class="check_label" for="label" >Gelezen</label>
</DIV>
</DIV>
<DIV class="clear" > </DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_checkbox"><LABEL class="cf_label">De bovenstaande gegevens en mijn pasfoto heb ik gecontroleerd en zijn compleet en correct. Indien dit niet het geval is, dan eerst deze gegevens in uw profiel wijzigen. Onvolledige aanvragen worden niet geaccepteerd</LABEL><INPUT class="radio validate-one-required" id="accoord"  type="checkbox" value="1" name="accoord" />  <label class="check_label" for="label" >accoord</label></DIV>
</DIV>
<DIV class="clear" > </DIV>

<DIV class="form_item">
<table style="height: 84px;" border="0" cellspacing="2" cellpadding="2" width="220">
<tr>
<td align="center">Aantal</td>
<td align="center">Prijs per pas</td>
</tr>
<tr>
<td align="center">1-19</td>
<td align="center">€ 90,00</td>
</tr>
<tr>
<td align="center">20-49</td>
<td align="center">€ 82,50</td>
</tr>
<tr>
<td align="center">> 50</td>
<td align="center">€ 75,00</td>
</tr>
</table></DIV>
<DIV class="clear" > </DIV>

<DIV class="form_item">De kosten zullen door de penningmeester dmv automatische incasso geind worden. <br /><br />
Voor instructeurs, die lesgeven aan de Bosmolenplas, wordt het pasje vergoed door de vereniging.<br /><br />
</DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_captcha" ><LABEL class=cf_label >Type hier de zwarte karakters in het veld</LABEL><SPAN >{imageverification}</SPAN></DIV>
</DIV>
<DIV class=clear > </DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_button" ><INPUT value="Versturen" name="undefined" type="submit"></DIV>
</DIV>
<DIV class="clear" > </DIV>

</DIV>

Max_admin 11 Feb, 2009
Hi, Sorry but I mean the form itself, the page so I can test it with Firebug!

Cheers
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.