Forums

[SOLVED] Fields not displaying in emails, only {tags} - V5

anakaine 26 Dec, 2013
Righto, so I've upgraded to v% of chronoforms, and applied the 25th december module update too, however I just cannot seem to get the details to come through in to an email. All that is displayed {input_name} for every input, except a text area, which is fine.

Additionally, I have all information set to record to a database, and this is happening perfectly. I can view the information submitted correctly, it's just the email that is notworking..

Lets answer some FAQs from V4(no V5 available yet) first:

Email body has input placeholders without data, for example: {input_name} or {input name}
1. If you have form inputs that are dynamically disabled then there will be no matching entry in the $form->data array and the email will show these values as {input_name}. The fix is to either use the built-in 'ghost' settings in the Wizard elements or to do this manually by adding hidden inputs with the same name at the beginning of the Form HTML.
There are no dynamically hidden fields

2. Input names should not contain any spaces or any special characters except underscores '_', and should start with a letter. You should fix this in your input names then make sure that the names match exactly in your email template.
Input names contain no spaces, some are even single word. Nothing aside from letters has been used.

3. If you made any changes to any of your fields names, then you will have to apply the same changes to the email template, or simply generate a new one.
Field names have not been changed. Have confirmed that they match the form code.

4. If ALL your input data are missing then you may have no server validation on your submission data, you should add one or more of the following to your form: Serverside validation (Auto and/or Custom), Captcha, ReCaptcha, Security question. A simple auto server side validation with few "required" fields should be enough, but it will not block spam bots, a Captcha is advised.
Captcha is present. Tried looking for serverside validation in the simple form designer, could not find.

5. If these are duplicated emails and the first copy had the correct content please see the Spam FAQ linked below.
Not a problem


Any other thoughts? All suggestions appreciated!
GreyHead 26 Dec, 2013
Hi anakaine,

I only installed v5 today so have very little experience with it. My test with a very simple form show the email including the form data correctly.

Unfortunately there is no debugger included yet that I can find which makes testing more difficult :-(

Bob
Max_admin 26 Dec, 2013
Hi,

Please drag a "custom code" action to the "on submit" event and write this code:


<?php
pr($form->data);
?>


What do you get after form submission now ?

And what are the contents of your email template ?

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
anakaine 27 Dec, 2013
Hi guys, thanks for the replies.

Specifically in reply to Admins post:

I tried as you suggested, but it didn't work for me. Here's the details.

The Form Code
<div class="form-group gcore-form-row" id="form-row-2"><label for="FirstName" class="control-label gcore-label-left col-sm-3">First Name</label>
<div class="gcore-input gcore-display-table" id="fin-FirstName"><input name="FirstName" id="FirstName" value="" placeholder="" maxlength="" size="" class="validate['required','alpha','nodigit'] form-control A" title="" style="" data-inputmask="" type="text" /></div></div><div class="form-group gcore-form-row" id="form-row-4"><label for="LastName" class="control-label gcore-label-left col-sm-3">Last Name</label>
<div class="gcore-input gcore-display-table" id="fin-LastName"><input name="LastName" id="LastName" value="" placeholder="" maxlength="" size="" class="validate['required'] form-control A" title="" style="" data-inputmask="" type="text" /></div></div><div class="form-group gcore-form-row" id="form-row-6"><label for="Email" class="control-label gcore-label-left col-sm-3">Email Address</label>
<div class="gcore-input gcore-display-table" id="fin-Email"><input name="Email" id="Email" value="" placeholder="" maxlength="" size="" class="validate['required','email'] form-control A" title="" style="" data-inputmask="" type="text" /></div></div><div class="form-group gcore-form-row" id="form-row-8"><label for="Phone" class="control-label gcore-label-left col-sm-3">Phone Number</label>
<div class="gcore-input gcore-display-table" id="fin-Phone"><input name="Phone" id="Phone" value="" placeholder="" maxlength="" size="" class="form-control A" title="" style="" data-inputmask="" type="text" /></div></div><div class="form-group gcore-form-row" id="form-row-9"><label for="Query" class="control-label gcore-label-left col-sm-3">Query</label>
<div class="gcore-input gcore-display-table" id="fin-Query"><textarea name="Query" id="Query" placeholder="" rows="3" cols="23" class="validate['required'] form-control A" title="" style=""></textarea></div></div><div class="form-group gcore-form-row" id="form-row-15"><label for="fld10" class="control-label gcore-label-left col-sm-3">Captcha</label>
<div class="gcore-subinput-container-wide" id="fitem12"><div class="gcore-input pull-left gcore-sub-input gcore-display-table" id="fin-fld11"><input placeholder="" maxlength="" size="" class="validate['required'] form-control A" title="" style="" type="text" name="captcha" id="fld11" /></div></div>
<div class="gcore-subinput-container-wide" id="fitem14"><div class="gcore-input pull-left gcore-sub-input gcore-display-table" id="fin-fld13">{captcha_img}</div></div></div><div class="form-group gcore-form-row" id="form-row-16"><div class="gcore-input gcore-display-table" id="fin-submit19"><input name="submit19" id="submit19" value="Submit" class="form-control A" style="" type="submit" /></div></div>



The content of the email template:
<div id="form-row-2" class="form-group gcore-form-row"><label class="control-label gcore-label-left col-sm-3" for="FirstName">First Name</label>
<div id="fin-FirstName" class="gcore-input gcore-display-table">{First Name}</div>
<div class="gcore-input gcore-display-table"> </div>
</div>
<div id="form-row-4" class="form-group gcore-form-row"><label class="control-label gcore-label-left col-sm-3" for="LastName">Last Name</label>
<div id="fin-LastName" class="gcore-input gcore-display-table">{Last Name}</div>
<div class="gcore-input gcore-display-table"> </div>
</div>
<div id="form-row-6" class="form-group gcore-form-row"><label class="control-label gcore-label-left col-sm-3" for="Email">Email Address</label>
<div id="fin-Email" class="gcore-input gcore-display-table">{Email Address}</div>
<div class="gcore-input gcore-display-table"> </div>
</div>
<div id="form-row-8" class="form-group gcore-form-row"><label class="control-label gcore-label-left col-sm-3" for="Phone">Phone Number</label>
<div id="fin-Phone" class="gcore-input gcore-display-table">{Phone Number}</div>
<div class="gcore-input gcore-display-table"> </div>
</div>
<div id="form-row-9" class="form-group gcore-form-row"><label class="control-label gcore-label-left col-sm-3" for="Query">Query</label>
<div id="fin-Query" class="gcore-input gcore-display-table">{Query}</div>
<div class="gcore-input gcore-display-table"> </div>
</div>
<div id="form-row-15" class="form-group gcore-form-row"><label class="control-label gcore-label-left col-sm-3" for="fld10">Captcha</label>
<div id="fitem12" class="gcore-subinput-container-wide">
<div id="fin-fld11" class="gcore-input pull-left gcore-sub-input gcore-display-table">{captcha}</div>
</div>
<div id="fitem14" class="gcore-subinput-container-wide">
<div id="fin-fld13" class="gcore-input pull-left gcore-sub-input gcore-display-table">{captcha_img}</div>
</div>
</div>


What happens after form submission:

The resulting web page displays this:
Thank you for submitting your query to The Dread Chick. She'll get back to you just as soon as she can.
Array
(
    [option] => com_chronoforms5
    [chronoform] => DreadChick_Enquiry
    [event] => submit
    [FirstName] => Simon
    [LastName] => Webster
    [Email] => sdw494@uowmail.edu.au
    [Phone] => 0404309380
    [Query] => This is a test with custom code on the 'on submit' event
    [captcha] => 
    [submit19] => Submit
)
Powered by ChronoForms - ChronoEngine.com


The resulting email looks like (copy / paste):
First Name
{First Name}

Last Name
{Last Name}

Email Address
{Email Address}

Phone Number
{Phone Number}

Query
This is a test with custom code on the 'on submit' event

Captcha


Attached is a screenshot, with requisite apologies over resolution, showing the 'on submit' methodology, and placement of custom php code suggested by Admin.


Thanks for all the help guys!

[attachment=0]FailForm.jpg[/attachment]
anakaine 27 Dec, 2013
Ironically, after typing all this, I have worked it out, and it turns out that one of the original FAQ answers I copy / pasted, I answered incorrectly.


When I read the FAQ, it mentioned that there should be no spaces in the element ID's. Sure, I went back, removed spaces. Saved, went and viewed email code, didn't see an spaces in the html 'for' label area. Glossed over it.

For the clarity of people reading this in the future, the {element ID} in the email template must be the same as the {element ID} in the form. Emphasis on the curly brackets. Then, things start working.

Thanks for replying to my initial post all - it wasn't until I had it all carefully placed in the last post that the light switch clicked. I feel like a bit of a goose, but this is a good learning post for others I guess.
GreyHead 27 Dec, 2013
Hi anakaine,

It's easy to get these mixed up :-(

Each form element (input, textarea, select drop-down, radio button, checkbox) will have a 'name' attribute, you'll see name='some_name' if you look at the Form HTML; it may also have an 'id' attribute e.g. id='some_id'. IDs are not required but I strongly recommend adding them, usually I make them the same as the name wherever possible.

Both names and IDs should start with a letter, contain no spaces or other special characters other than underscore '_'. This is partly an HTML requirement and partly because ChronoForms may use the name or ID as a PHP variable name or a MySQL column name and each of these has slightly different requirements.

In most cases ChronoForms uses the name attribute - in the email template, etc.

Names can be duplicated in the same page (this is what happens with 'ghost' settings for checkboxes and radio buttons). IDs must be unique - amongst other things they are used by JavaScript to pinpoint exactly which element on the page to act on. You will see this, for instance, in a radio button group where all the buttons have the same name but the ids are different usually somne_name_0, some_name_1, . . .

Bob
IGJ 11 Jul, 2014
Hi

I know this is an old and solved thread. But i'm having the same problem with my email and then, only some of the times it doesnt work, and the other half of the time it does.

Sometimes the email is getting shown just fine, with all the stuff thats supposed to be in it. But other times the tag names are only getting shown in the received emial and not the info thats supposed to be in it.

I have attached to new mails that are under 24 hours old. The one is with the tags and the other just seven and a half hours later looks just fine.

What is wrong? And why does it work most of the time and then suddenly doesnt. I have also attached the config of the checkbox and what the nams are in the template.

Regards
Ivan
IGJ 11 Jul, 2014
Hi Greyhead

Thanks for the reply.

I have a handle arrays in the on submit action. I have also a ghost for each checkbox. I have also made four of the five textboxes required.

From the FAQ I can't see what i'm doing wrong. But why is it working most of the time and some other times only {input_checkbox_12} ore something like that is getting shown. Should I put some data in the handle array function ore is it like i suppose just drag and drop and it will work from the start?
GreyHead 11 Jul, 2014
Hi IGJ,

It's unclear to me if these are emails you are receiving; or are you seeing this result when you test the form?

If it's when you are receiving them. please check the FAQ again. I can't think that it has anything to do with checkbox groups - more likely that you are being spammed (or virus scanned) and your validation isn't blocking those submissions.

Bob
IGJ 11 Jul, 2014
Hi Greahead

Its when I receive the mails from the form. I'm using plain checkboxes not checkbox groups, but I don't think that matters.

Sorry but the FAQ is more confusing than beneficial for me.
GreyHead 11 Jul, 2014
Hi IGJ,

Then this is almost certainly form spam (or from a bot of some kind). You need to add serverside validation to block the blank entries.

Bob
IGJ 11 Jul, 2014
Hi Greyhead

Should this drag the server side validation on the submit event? And is it just drag and drop or do I have to set something up in the validation?

Should it also been dragged before the email event.

Regards
Ivan
GreyHead 12 Jul, 2014
Hi IGJ,

You have to set it up. If you use the Automatic version you need to add lists of input names. If you use the Custom version you need to add PHP to 'do' the custom validation.

Bob
IGJ 14 Jul, 2014
Hi Greyhead

With input names you mean Field names right? I will go for the automatic server side validation.
Where should I drag that automatic server side validation. On the submit event right. Should it be before another event?
In my form there are five text text fields. Four of them are required, the mail is not optional. I have three checkboxes.
When I look at the automatic validation there are fields like required, not empty and empty. The four text fields should be set in required? What about the email field? And what about the checkboxes. The checkboxes are not set to required, because the customer can choose from the three different options. What should be set for them, so theres not getting shown the ugly input_checkbox_12 or something like that, and also the email field.

Regards
Ivan
GreyHead 14 Jul, 2014
Hi Ivan,

Yes it goes in the On Submit event. It should go in a logical sequence, normally after any Capcha check but before emails or DB Saves.

The validation is whatever you need. If the the text inputs are required then add them to the Not Empty box. You might also add the email to the Email box. If the checkboxes aren't required them leave them out.

Bob
IGJ 02 Aug, 2014
Hi Greyhead

Thanks for the reply. I wil give it a try. The three checkboxses customers can choose to get a catalog and the two other choices are demonstration at home or at a local meeting. The customer schould choose one ore more of those three, but all the checkboxes can't be left blank. How can I get that done with the validation. Right now they are single checkboxes and not a group.

Regards
Ivan
GreyHead 02 Aug, 2014
Hi IGJ,

Either you make them a checkbox group and make it required; or you add custom validation to check that at least one of the checkboxes is set. There's no automatic way I know of to validate that one of several separate checkboxes is selected.

I don't think that you need to replace them to make a checkbox group; just give them all the same array name.

Bob
IGJ 03 Aug, 2014
Hi Greyhead

Thanks for the reply 😀

How do I make a custom validaton for checking that at leat one of the three checkboxses are checked? I tried to implement a checkbox group as we talked about before, but the thing look very ugly and look messed up in the form, so I went back to single checkboxses.

I also have one of the textboxes for telephone number. I have tried the FAQ you are referring to in this old thread http://www.chronoengine.com/forums/posts/f2/t89985.html. But I cant get it to work, it still submits even if I put in just two numbers. I have set the textbox to max 8 characters. Class box is that the same as field class for the specific textbox? I have set the textbox thats for the phone number to required and to number and for phone, but thats not working either.

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