Change event
Bojidar Chotorov created the topic: Change event
Hello,
I have two date fields and I want that the number of days is displayed into a third field (must be easy:).
OK, I will write the function but I can't handle the change event. When I call it with jQuery nothing happens. What's wrong?
Here is the form:
www.pelican-birding-lodge.com/newsite/en...6%D0%B5%D0%BD%D0%B8/
This is the code from the java script form options:
// before form is load
function before_load() {
}
// before form submit
function before_submit() {
}
// before form reset
function before_reset() {
}
$( "#wdform_2_element10" ).change(function() {
alert( "Handler for .change() called." );
});
Thank you!
Please Log in or Create an account to join the conversation.
- Topic Author
- Bojidar Chotorov
- Offline
- Fresh Boarder
- Posts: 14
- Thank you received: 0
9 years 2 days ago
Support replied the topic: Change event
Dear Bojidar,
Instead of code added by you add this one
jQuery(document).ready(function() {
jQuery ( "#wdform_2_element10" ).change(function() {
alert( "Handler for .change() called." );
});
});
Best regards,
Web-Dorado team
Joomla extensions ,
Wordpress plugins ,
Drupal modules
Please Log in or Create an account to join the conversation.
9 years 2 days ago
Bojidar Chotorov replied the topic: Change event
Thank you very much! It is OK but I have an other issue related with this event.
When the user selects a date from a calendar the change event doesn't work. How to handle this event so that I calculate the third field?
Kind regards!
Please Log in or Create an account to join the conversation.
- Topic Author
- Bojidar Chotorov
- Offline
- Fresh Boarder
- Posts: 14
- Thank you received: 0
9 years 1 day ago
Support replied the topic: Change event
Dear Bojar,
Make sure that you have a piece of javascript for data change which is responsible for re calculating when any of dates is changed.
Best regards,
Web-Dorado team
Joomla extensions ,
Wordpress plugins ,
Drupal modules
Please Log in or Create an account to join the conversation.
9 years 1 day ago
Bojidar Chotorov replied the topic: Change event
Hello,
Thank for your fast reply!
Yes, I will calculate the difference between the dates.
The problem is that I want that the calculation happens when the date is selected from the Calendar and set in the input field.
When the user types some data by hand then this is a "change" for the input field but when the data comes from the Calendar this is not considered as "change" neither as "paste" or something else. I tried to use jQuery datepicker but this is not the solution.
So, the question is what is the right jQuery event and which object to use?
Kind regards!
Bojidar
Please Log in or Create an account to join the conversation.
- Topic Author
- Bojidar Chotorov
- Offline
- Fresh Boarder
- Posts: 14
- Thank you received: 0
9 years 1 day ago
Support replied the topic: Change event
Dear Bojidar,
We tested your form and date field calculator works as it should. Pleases clear cache and try again.
Best regards,
Web-Dorado team
Joomla extensions ,
Wordpress plugins ,
Drupal modules
Please Log in or Create an account to join the conversation.
8 years 11 months ago
Bojidar Chotorov replied the topic: Change event
Dear Support Team,
Yes, it works because I found a solution to our case. It is not the best one but it works.
We will use
jQuery(document).click(function() {
....
}
so that the application reacts when a date is selected from a Calendar.
If there is a better solution, please inform us.
Regards and thank you!
Bojidar
Please Log in or Create an account to join the conversation.
- Topic Author
- Bojidar Chotorov
- Offline
- Fresh Boarder
- Posts: 14
- Thank you received: 0
8 years 11 months ago