can you pls set that code in Form Pieces -> Before form
$this->execPieceByName('ff_InitLib'); it must be used so you can actually use methods/funcitons like ff_SetValue so its crucial to have that.
Regards,
Tome
Regards,
Tome
==========================================
Need to renew Pro Support? Buy Here!
==========================================
Satisfied? Consider a membership!
==========================================
Like us on Facebook
==========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5 Here!
I tested that with simple form with one textfield and I can see the date and time.
Regards,
Tome
Regards,
Tome
==========================================
Need to renew Pro Support? Buy Here!
==========================================
Satisfied? Consider a membership!
==========================================
Like us on Facebook
==========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5 Here!
Yes, it does work. The problem is Form Pieces -> Before enters the time when the form is rendered not when it's submitted. So the form could be sitting there for 20 minutes and then it's submitted. The "CheckInTime" will be 20 minutes too early, inaccurate.
If it works with Pieces -> Before, why doesn't it work with Submit Pieces --> Begin Submit?
((==> Before Submit: PHP that will be executed before the form is going to be submitted. You can use this for example catching values and prevent storing a submission.))
I'm treating Begin Submit like onSubmit which is what I need. When the form is submitted put Date/Time in element 'checkintime'.
I have a Backend view (using ContentBuilder) that shows all of the fields that the form submitted.
Ok here how things are working, to get the current realtime value we need to use JavaScript not PHP, so I research a bit and found a cool solution with Moment.js library. pls follow the steps below.
1. Create a folder called js in media/breezingforms/js and put in it 3 files I attached you below:
3. I guess your element is called checkintime like you said in first post. Now Go to Scripts -> Initialization Script -> Create new framework and put setInterval function in it (look how my example looks)
function ff_YOURFORMNAME_init()
{
setInterval(timeTrack, 500);
} // ff_YOURFORMNAME_init
function timeTrack() {
var timeValue = moment().tz('America/Chicago').format('hh:mm:ss a');
var dateValue = moment().format('L');
ff_getElementByName('YourElementName').value =dateValue + ' -- ' + timeValue;
}
So you only need to change the YourElementName with checkintime
4. Go to your frontEnd check the form and you will see date and time in real time
Test the form now and let me know the result.
Regads,
Tome
Regards,
Tome
==========================================
Need to renew Pro Support? Buy Here!
==========================================
Satisfied? Consider a membership!
==========================================
Like us on Facebook
==========================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5 Here!
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!