Title: How can I use the Javascript functionality ?
Last modified: July 21, 2025

---

# How can I use the Javascript functionality ?

 *  Resolved [eragonsoftware](https://wordpress.org/support/users/eragonsoftware/)
 * (@eragonsoftware)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/how-can-i-use-the-javascript-functionality/)
 * Hi, I have just recently purchased a subscription to this module, and I was wondering
   where’s the documentation as to how could I use the Javascript functionality 
   of the plugin ?
   I need to check a field upon input, from a database, and for 
   that I need to have an ajax call made to a php file… do you have any documentation,
   examples for the paid version ?Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [SAASPROJECT](https://wordpress.org/support/users/masaakitanaka/)
 * (@masaakitanaka)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/how-can-i-use-the-javascript-functionality/#post-18565511)
 * This guide explains how to monitor a specific input field (e.g., “First name”)
   and retrieve the value entered by the user when the Booking Package form is displayed.
 * How it works
    1. **Event Monitoring** Using the `bookingPackageUserFunction` feature, you can
       listen for the `'displayed_booking_form'` event, which signals that the booking
       form has been displayed.
    2. **Element ID Rule** Each input field is assigned a unique ID (e.g., `first_name`).
       The `id` of the actual HTML element is created by adding the prefix `booking_package_input_`
       to this unique ID.
    3.  - **Prefix**: `booking_package_input_`
        - **Unique ID**: `first_name`
        - **Final ID**: `booking_package_input_first_name`
 * Code Example
 * The following code gets the “First Name” input field after the booking form appears
   and then outputs its value to the console each time the user types.
   You can use
   this code by pasting it into your theme’s JavaScript file or a similar location.
 *     ```wp-block-code
       window.addEventListener('bookingPackageUserFunction', function() {    // Monitor for Booking Package events.    bookingPackageUserFunction.notification(function(eventName, calendarId, uniqueId) {        // Run the following process only when the booking form is displayed.        if (eventName === 'displayed_booking_form') {            // Get the "First Name" input field element.            const firstNameField = document.getElementById('booking_package_input_first_name');            // If the element was found, proceed.            if (firstNameField) {                console.log('Found the "First Name" field. Monitoring for input.');            } else {                console.error('Could not find the "First Name" field.');            }        }    });});
       ```
   
 *  Thread Starter [eragonsoftware](https://wordpress.org/support/users/eragonsoftware/)
 * (@eragonsoftware)
 * [10 months, 1 week ago](https://wordpress.org/support/topic/how-can-i-use-the-javascript-functionality/#post-18569988)
 * Thank you, I have successfully implemented this. 
   I will start a new topic with
   the error that just appeared immediately after upgrade to 1.6.9

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How can I use the Javascript functionality ?’ is closed to new replies.

 * ![](https://ps.w.org/booking-package/assets/icon-128x128.png?rev=1829374)
 * [Booking Package](https://wordpress.org/plugins/booking-package/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/booking-package/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/booking-package/)
 * [Active Topics](https://wordpress.org/support/plugin/booking-package/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/booking-package/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/booking-package/reviews/)

## Tags

 * [paid version](https://wordpress.org/support/topic-tag/paid-version/)

 * 2 replies
 * 2 participants
 * Last reply from: [eragonsoftware](https://wordpress.org/support/users/eragonsoftware/)
 * Last activity: [10 months, 1 week ago](https://wordpress.org/support/topic/how-can-i-use-the-javascript-functionality/#post-18569988)
 * Status: resolved