Hi ... I am very much a beginner so please have patience.
I am wanting to calculate the difference between Start kilometres and End kilometres.I have tried:
Any help?
I am wanting to calculate the difference between Start kilometres and End kilometres.I have tried:
$("#field1,#field2").on("change", function(){ $("#total").val(parseInt($("#field1").val()) + parseInt($("#field2").val())); });from the FAQ's but I am not getting a result.
Any help?
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
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 Bob
Thanks for the response.
The actual that I have used is as follows and it is in a Java custom element
Thanks for the response.
The actual that I have used is as follows and it is in a Java custom element
$("#field_text19,field_text20").on("change", function(){
$("#field_text23").val(parseInt($("field_text19").val()) + parseInt($("#field20").val()));
});
This is link to the front end ... do you need access to Joomla Admin?
www.dataware.co.za
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
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.
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.
Hi Karl,
Now you have left out most of the # s which are used to identify the strings as IDs
Bob
Now you have left out most of the # s which are used to identify the strings as IDs
$("#start_kms, #end_kms").on("change", function(){Important - don't copy and paste the code from the forums as that adds invisible characters that may stop the code working :-(
$("#trip_kms").val(parseInt($("#end_kms").val()) - parseInt($("#start_kms").val()));
});
Bob
That's embarassing 😟
Still no result
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
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.
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?
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}
{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} ?
Would the current time be similar {time:HH:mm} ?
{date:H:i}
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
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 do
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
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.
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
http://php.net/manual/en/timezones.php
Have I understood the options correctly?
I still get GMT
{date/timezone:H:i$Africa/Johannesburg}
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 🙂
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
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
Or just change the "actual value" to the format you want
This topic is locked and no more replies can be posted.