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!

#24458

Please Log in or Create an account to join the conversation.


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
#24505
The following user(s) said Thank You: Bojidar Chotorov

Please Log in or Create an account to join the conversation.


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!

#24535

Please Log in or Create an account to join the conversation.


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
#24551

Please Log in or Create an account to join the conversation.


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

#24564

Please Log in or Create an account to join the conversation.


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
#24609
The following user(s) said Thank You: Bojidar Chotorov

Please Log in or Create an account to join the conversation.


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

#24640

Please Log in or Create an account to join the conversation.


Time to create page: 0.211 seconds
Powered by Kunena Forum

WORLD-CLASS SUPPORT

We are here for you every step of the way. Turn to our support with any questions you might have about our products and services. Our experienced customer care team is available to help you as fast as we possibly can.

Contact us