Forums

Form problem ??

pdenessen 02 Dec, 2008
Hi Guys,

I just installed Chronoforms and are setting up a form. The form was working so far, but for certain unknown reason, there is a problem with the posting to the database.
I connected the form to a database, but now all the text fields in the form field types of the autogenerated code are not generated anymore.

Below is my Form code.

Who can help me ?

<DIV class=form_item >
<DIV class="form_element cf_text" ><SPAN class=cf_text >Aanmeld formulier Nieuwjaarsduik</SPAN></DIV>
<DIV class=clear > </DIV>
</DIV>

<DIV class=form_item >
<DIV class="form_element cf_textbox" ><LABEL class=cf_label >Voornaam </LABEL><INPUT class="cf_inputbox required" id=voornaam maxLength=150 size=30 name=voornaam ></DIV>
<DIV class=clear > </DIV>
</DIV>

<DIV class=form_item >
<DIV class="form_element cf_textbox" ><LABEL class=cf_label >Naam </LABEL><INPUT class="cf_inputbox required" id=naam maxLength=150 size=30 name=naam ></DIV>
<DIV class=clear > </DIV>
</DIV>
<DIV class=form_item >
<DIV class="form_element cf_textbox" ><LABEL class=cf_label >Adres </LABEL><INPUT class="cf_inputbox required" id=postcode maxLength=150 size=30 name=adres ></DIV>
<DIV class=clear > </DIV>
</DIV>

<DIV class=form_item >
<DIV class="form_element cf_textbox" ><LABEL class=cf_label >Postcode </LABEL><INPUT class="cf_inputbox required" id=postcode maxLength=7 size=7 name=postcode ></DIV>
<DIV class=clear > </DIV>
</DIV>

<DIV class=form_item >
<DIV class="form_element cf_textbox" ><LABEL class=cf_label >Plaats </LABEL><INPUT class="cf_inputbox required" id=plaats maxLength=150 size=30 name=plaats ></DIV>
<DIV class=clear > </DIV>
</DIV>

<DIV class=form_item >
<DIV class="form_element cf_textbox" ><LABEL class=cf_label >Telefoon </LABEL><INPUT class="cf_inputbox required" id=telefoon maxLength=150 size=30 name=telefoon ></DIV>
<DIV class=clear > </DIV>
</DIV>

<DIV class=form_item >
<DIV class="form_element cf_textbox" ><LABEL class=cf_label >Email adres</LABEL><INPUT class="cf_inputbox required validate-email" id=email maxLength=150 size=30 name=email ></DIV>
<DIV class=clear > </DIV>
</DIV>

<DIV class=form_item >
<DIV class="form_element cf_dropdown"><LABEL class=cf_label >T-shirt maat</LABEL><DIV class="form_element cf_dropdown">
<select class="cf_inputbox validate-selection" id=t-shirt size=1 name=t-shirt >
<option value=" Small" selected > Small</option>
<option value=" Medium" > Medium</option>
<option value=" Large" > Large</option>
<option value=" Xlarge" > Xlarge</option>
<option value=" XXLarge" > XXLarge</option>
</select></DIV>
<DIV class=clear > </DIV>
</DIV>

<DIV class=form_item >
<DIV class="form_element cf_checkbox"><LABEL class=cf_label >Deelname aan het evenement is geheel op eigen risico</LABEL><INPUT class="radio validate-one-required" id=Gelezen type=checkbox value="1" name=Gelezen /> <label class=check_label for=label >Gelezen</label>
<DIV class=clear > </DIV>
</DIV>
</DIV>

<DIV class=form_item >
<DIV class="form_element cf_button" ><INPUT type=submit value=Versturen ></DIV>
<DIV class=clear > </DIV>
</DIV>
pdenessen 02 Dec, 2008
Hi Guys,

I think I solved the problem. I just discoverd that a lot of " Id and type fields disappeared.
I have no clue how this has happened, but I am sure, I did not remove them myself.

Does anyone else has the same expierence ?
pdenessen 02 Dec, 2008
I had hoped I had fixed it, but still get this error message :

Parse error: syntax error, unexpected '-', expecting ',' or ';' in /home/xxxx/public_html/site/components/com_chronocontact/chronocontact.php(41) : eval()'d code on line 17

And here is my latest code. Who sees what problem there is ?
<DIV class="form_item">
<DIV class="form_element cf_text" ><SPAN class="cf_text" >Aanmeld formulier Nieuwjaarsduik</SPAN></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item">
<DIV class="form_element cf_textbox" ><LABEL class="cf_label" >Voornaam </LABEL>
<INPUT class="cf_inputbox required" id="voornaam"  maxLength="150" size="30" name="voornaam" type="text"></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item">
<DIV class="form_element cf_textbox" ><LABEL class="cf_label">Naam </LABEL><INPUT class="cf_inputbox required" id="naam"  maxLength="150" size="30" name="naam" type="text"></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item">
<DIV class="form_element cf_textbox" ><LABEL class="cf_label" >Adres </LABEL><INPUT class="cf_inputbox required" id="adres" maxLength="150" size="30" name="adres" type="text"></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item">
<DIV class="form_element cf_textbox" ><LABEL class="cf_label" >Postcode </LABEL><INPUT class="cf_inputbox required" id="postcode"  maxLength="7" size="7" name="postcode" type="text"></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item">
<DIV class="form_element cf_textbox" ><LABEL class="cf_label">Plaats </LABEL><INPUT class="cf_inputbox required" id="plaats"  maxLength="150" size="30" name="plaats" type="text"></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_textbox" ><LABEL class="cf_label">Telefoon </LABEL><INPUT class="cf_inputbox required" id="telefoon"  maxLength="150" size="30" name="telefoon" type="text"></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_textbox" ><LABEL class="cf_label">Email adres</LABEL><INPUT class="cf_inputbox required validate-email" id="email" maxLength="150" size="30" name="email" type="text"></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_dropdown"><LABEL class="cf_label" >T-shirt maat</LABEL>
	<select class="cf_inputbox validate-selection" id="t-shirt" size="1" name="t-shirt" >
          <option value=" Small"  > Small</option>
          <option value=" Medium" > Medium</option>
          <option value=" Large" > Large</option>
          <option value=" Xlarge" > Xlarge</option>
          <option value=" XXLarge" > XXLarge</option>
    </select></DIV></DIV>
<DIV class="clear" > </DIV>
</DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_checkbox"><LABEL class="cf_label">Deelname aan het evenement is geheel op eigen risico</LABEL><INPUT class="radio validate-one-required" id="Gelezen"  type="checkbox" value="1" name="Gelezen" />  <label class="check_label" for="label" >Gelezen</label>
<DIV class="clear" > </DIV>
</DIV>
</DIV>

<DIV class="form_item"   >
<DIV class="form_element cf_button" ><INPUT  type="submit" name="undefined" value="Versturen" ></DIV>
<DIV class="clear" > </DIV>
</DIV>
GreyHead 02 Dec, 2008
Hi pdenessen,

Line 41 is loading the DB Classes info so the problem isn't with the from html code but with the DB Connection info that ChronoForms has stored.

I'm not clear exactly what is stored - Max might have a better idea.

Bob
pdenessen 02 Dec, 2008
Hi Bob,

the problem is fixed. A similair problem was else on the forum.
The issue was the - in t-shirt as name, which caused errors when connecting to the database.

However, I am not quite sure if this has to do with the swedish language setting in the database or that it is not allowed to use - in fieldnames.
GreyHead 02 Dec, 2008
Hi pdnessen,

'-' isn't allowed in database table names unless the name is quoted e.g "t-shirt" is OK t-shirt isn't.

Bob
pdenessen 02 Dec, 2008
Hi Bob,

strange then I believe my code was correct and lies the problem within the swedish characterset, or does the tablename within the MySQL database also needs to have the quotes?

(Sorry to bother, but after 5 hours of debugging, I want to know it now🙂

Another question : I am trying to get catpcha working with Chronoforms. Where do I find a instruction for that? I haven't installed any image verification so far on my J1.5 site.

Patrick
GreyHead 02 Dec, 2008
Hi pdenessen,

It's in the actual SQL statement:
SELECT field-name FROM . . .
is technically invalid unless the fieldname is quoted
SELECT `field-name` FROM . . .
. And MySQL can be fussy about quotes, usually back-ticks ` ` are OK and so are double quotes " " but single quotes are troublesome.

The easiest fix is to use the Joomla built-in methods
SELECT $db->quoteName('field-name') FROM . . .
and the corrresponding $db->quote() for values.

Bob
Max_admin 02 Dec, 2008
Hi,

Change "t-shirt" in your fields names to "t_shirt", recreate a table and connect to the new one and ignore the old one!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
pdenessen 02 Dec, 2008
Ok, thanks for all support.

It is working now, including the Captcha (755) issue.


Patrick
This topic is locked and no more replies can be posted.