Forums

Custom Code + Captcha - Strange behavior

galbur 29 Aug, 2014
Hi

i have this strange behavior in my chronoforms5 form.
i builded a form with the wizard, copy the code in an editor, made some layout changes.
then i use the new code as "custom-code" in the form (after deleting all fields i did before), save.. and... everything is fine.
the form works. now, when i do a little change in the form (even, wehn i only save teh form without any changes) the form doesn't work anymore.
the form looks like this and there is some code in the text-field aera:

[attachment=0]printscreen1.png[/attachment]

maybe a copy of the form would help, but it seems that is not allowed to upload *.bak-files

thank you
chris
GreyHead 29 Aug, 2014
Hi galbur,

Most likely you have an unclosed <div> or a missing quote in your edited HTML. I'd check that first.

Bob

PS You can upload zipped files here.
galbur 29 Aug, 2014
Hi bob
thank you very much.
here is the zip-file...

cheers
chris
GreyHead 29 Aug, 2014
Hi Chris,

I don't see any textarea in the form you sent. Is it the right one XX_Clip_Call_Wettbewerb

Bob
galbur 01 Sep, 2014
Sorry!
Wrong File ;-( ...
Here is the right one.

Thank you

Chris
GreyHead 01 Sep, 2014
Hi Chris,

Looks like you've lost a chunk of code, it stops dead in the middle of a table row
      <td>Bemerkungen:</td>
      <td> </td>
      <td> </td>
    </tr>
    <tr>
      <td colspan="3"><textarea name="nachricht" id="nachricht" placeholder="" rows="8" cols="60" class=" validate['required']" title="" style="" data-wysiwyg="0" data-load-state="" data-tooltip="">
. . . // there's nothing after this
galbur 01 Sep, 2014
Hi Bob

Yes i know. The Code was complete and after changing a litte thing and after saving, some code was suddenly missing.
GreyHead 01 Sep, 2014
Hi Chris,

I added the missing </textarea> tag and was able to add and save more HTML without any problem.

I am not clear what you are trying to do by using the Wizard code as Custom Code?

Bob
galbur 01 Sep, 2014
Hi Bob

The Idea was to build the form with the wizard, then to copy the whole code to dreamweaver.
In Dreamweaver i can modify the code (putting the fields in a table, adding some classe etc.) then i go back to the form, delete all fields i builded before, instead i put the code from dreamweaver in a "custom field". Voilà..

This worked very well for several projects with chronoform 4. With chronoform5 i have had problems (as described) with two projects. For Example: i have a working form (see backup) i just copy that form in chronoforms and after copying i have this effects (stripping some code away).

But maybe it's a bad idea to work with forms like this and i maybe should rebuild my forms?


Chris
GreyHead 13 Sep, 2014
Hi Chris,

The form elements in Cfv5 are pretty flexible now and unless you want some very customised layout I'd stick with them as far as practical.

If you want to include chunks of custom HTML then I use Custom element elements in the Designer view rather than edit the code window directly. The approach you are using should work OK like that, It is also possible to use PHP include statements to add files of code into form elements or actions. I frequently use these to include PHP, JavaScript and HTML. The code I use is this - though with different file names:
<?php
include (JPATH_SITE.'/components/com_chronoforms5/includes/'.$form->form['Form']['title'].'/load_js.js');
?>


The advantage of this approach is that you can use your preferred code editor (Sublime Text 3 in my case) rather than trying to work in textareas and you can update the code with FTP without having to open, edit and re-save the form each time.

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