Record ID in Email Subject

  • Posts: 15
  • Thank you received: 0

LaurieM replied the topic: Record ID in Email Subject

Thanks Mario!

I've worked this out such that the field will pre-populate with the count but can be overridden by typing in a government issued number if available.

The client has had a change of mind and now all I need is the pre-populated count. All good!

Thanks,
Laurie.
#236749
  • Posts: 15
  • Thank you received: 0

LaurieM replied the topic: Record ID in Email Subject

Hi there!

I'm afraid I'm still having trouble with this.

I have the count working OK. However, because the count +1 is recorded when the form is opened, if more than one person is filling in the form at the same time the count is duplicated.

The record ID in the form records and in the database is correct, that is, it increments by 1 as expected.

Therefore, is it possible to use the record ID in the subject line of the notification emails instead of the count? This would facilitate using the email subject for tracking purposes.

Thanks,
Laurie.
#237115
  • Posts: 15
  • Thank you received: 0

LaurieM replied the topic: Record ID in Email Subject

Hi there!

I still need to get a unique identifier into the subject line of the Admin and Mailback notifications.

Neither of the calendar fields will do the job as they give only the date and not the time.

The code suggested earlier in this post is not suitable as when two people open the form concurrently the count+1 is the same for two submissions.

Is there any way I can get a reliable unique identifier into the subject line of the notifications?

A new feature where I could add a hidden field with an element that gives the date and time the form was opened would be great.

Thanks,
Laurie.
#237158
  • Posts: 2561
  • Karma: 87
  • Thank you received: 344

mihaela replied the topic: Record ID in Email Subject

Hi,

Regarding the wrong count, please take a look at this piece of documentation crosstec.org/en/blog/939-count-number-of-records.html .

Here it is explained how to get the record count at the moment of submitting the form.
That way, the chances of getting the same record count are absolutely minimized.

Please implement this solution to your form.
Also, the code to add date and time to the hidden field can be added to the beginning of Actionscript of the submit button element like this:
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = date+' '+time;
ff_getElementByName('HIDDENELEMENTNAME').value = dateTime;

Let me know whether you have managed to set this for your form.

Regards,

Mihaela
#237161
The following user(s) said Thank You: LaurieM
  • Posts: 15
  • Thank you received: 0

LaurieM replied the topic: Record ID in Email Subject

Hi there Mihaela!

Thanks for that help.

I have the count solution working in a test environment, but when I implement it in the intranet, the form won't submit.

When I get access to the intranet again in the coming days I intend to progressively remove features and fields from the form. I'm thinking there may be some conflict that the environment can't handle. My first target will be some code in the form pieces for fixing the calendar:
echo "
<script>
 jQuery(document).ready(function(){
	ff_getElementByName('DateBirth').addEventListener('click', function() {
	document.querySelector('#ff_elem1187_calendarButton').focus();	
});
    });
 </script>
";
echo '<script type="text/javascript">
                                        
    JQuery(document).ready(function () {
                             
        JQuery("#ff_elem1187_calendarButton").pickadate({
			format: "dd-mm-yyyy", 
                       selectYears: 101, 
			min: [1920,1,1], max: [2030,12,31],
                        selectMonths: true,
                        editable: true,
                        firstDay: 1,
			onSet: function() {JQuery("#ff_elem1187").val(this.get("value"));}
		});
        });
</script>';

It seems that there is something in the intranet environment, that's not in my test environment, causing the submit failure. Are you able to suggest any likely culprits?

Note: In the intranet, a test form with little more than the count method suggested in the post above, submits.

Thanks,
Laurie.
#237511
Moderators: ForumSupporttomeperica
Time to create page: 0.076 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here