Hi Karl,
What are the IDs of your inputs - you need to replace total, field1 and field2 with these.
And do you have this code in a JavaScript Custom element?
Bob
Hi Karl,
Please post a link to the form so we can take a quick look.
Bob
This is link to the front end ... do you need access to Joomla Admin?
www.dataware.co.za
Hi Karl,
Your JavaScript needs to use the IDs of the form elements which are start_kms, end_kms and trip_kms
Also I suspect that you should not be adding the start and end kms to get the trip length.
Bob
Haha ... you are right ... my calculation is incorrect. I just used the simplest calc until I get it working, and understand what I am doing.
Then I will worry about the maths 🙂
I have made the change to no avail:
$("#start_kms,end_kms").on("change", function(){
$("trip_kms").val(parseInt($("start_kms").val()) + parseInt($("end_kms").val()));
});
I have my start, end and trip one beneath the other with the Java beneath all 3.
I have all 4 in a Group Area.
That's embarassing 😟
Still no result
Hi Karl.
There is a JavaScript Error on the page - it looks like some of those pesky invisible characters have gotten into the script.
Bob
Thanks so much for the help ... it's working 🙂
After reading:
Important - don't copy and paste the code from the forums as that adds invisible characters that may stop the code working :-(
I realized that I had copied the script originally from the FAQ's.
I manually typed it out and it works.
Again thank you.
One more question:
I have a date field and a time field. Is there any way I have these defaulting to current date and time when I open the form?
In the "value" field put {date:format} change foprmat depending on the field.
Thanks ... am I understanding correctly?
{date:DD/MM/YYYY}
No it should match the format of the field's "actual value" so probably {date:Y-m-d}
Thanks so much ... that works🙂
Would the current time be similar {time:HH:mm} ?
I am still getting the popup calendar 😟
What do you mean? Have you set it to time instead of date or datetime?
I have the following:
Value: {date:H:i}
Start day: Monday
Start mode: Day
Type: Date
Display: HH:ss
Okay so you see where it says type:date ?
I have also tried changing that to Time but still no result
NO result? Shows nothing at all?
Correct ... on Date or Time
Value: {date:H:i}
Type: Time
Display format: HH:mm
Real Format: HH:mm
DO NOT copy+paste from the forums, adds hidden characters
Thanks🙂
I haven't copied / pasted anything. I type from scratch.
Great thanks. I am getting a default time but it is GMT. My PC and Joomla time are set at GMT+2
{date/timezone:format$options}
http://php.net/manual/en/timezones.php
Have I understood the options correctly?
I still get GMT
{date/timezone:H:i$Africa/Johannesburg}
No, the timezone goes where I put the word "timezone"
Thanks so much for your support and patience ... much appreciated.
All working correctly 🙂
Hi ...
The date field is formatted as I wanted on the screen.
When I Submit the email that I have receive has a different format for the date.
Can I 'force' the format to be the same on screen and in the email received?
Thanks
{date:format$(data:date_field)}
Or just change the "actual value" to the format you want