Code Monkey home page Code Monkey logo

Comments (9)

laander avatar laander commented on July 27, 2024 1

@ChrisChinchilla Jep, see the example here and look at the callbacks section. The submitBookingForm callback is what you'll want.

We are working on a much improved release of our API that has native support for bookings with all customer data neatly organized. In that way, you'll be able to query our API and retrieve that (and in the near future, also add confirm/decline flows and more).

from booking-js.

riusi88 avatar riusi88 commented on July 27, 2024

My quick workaround until this feature is implemented was duplicating existing fields in booking.js and renaming them appropriately, changing the input type to whatever I needed and following the correct syntax. The values for these new fields do get dropped in the response json object.

from booking-js.

jhanstra avatar jhanstra commented on July 27, 2024

I used the same workaround as @riusi88. It would be nice to create unlimited custom booking fields in the future though without this workaround.

from booking-js.

ChrisChinchilla avatar ChrisChinchilla commented on July 27, 2024

Thirded. @riusi88 Are you saying that even though you add the fields and change the names, the values don't actually come to you in any way?

from booking-js.

laander avatar laander commented on July 27, 2024

@riusi88 @jhanstra @ChrisChinchilla

The difficulty is deciding where the data should be saved. For now, we're simply passing all the form data to a calendar event and e.g. comment and phone number is saved in the event description (non-structured). It's really not optimal, but it works in the short run.

We're working on a new backend feature where bookings are their own first-class citizen, have states and where customer data are saved in a more structured format.

For this, I'd like your inputs:
Would you like the form data to be queryable via the Timekit API? Or do you want it sent to your email when booked? Or simply added to the event description like it is now?

from booking-js.

riusi88 avatar riusi88 commented on July 27, 2024

@ChrisChinchilla
Sorry for the late response, but as @laander explains all the data get's dumped into the event description as line items. You can fetch this from createEventSuccessful: function(response){}

@laander
Thanks for the reply, and I appreciate you asking for our input!
Although this may be the hardest to implement, I would definitive like to query the form data for each field via the API.
In my case, I was also posting the booking data to a separate form handler and had to query the values of each input box inside the booking form on the client side. It would have been helpful to skip this step if I was able to query the response object for each field separately and post them to my matching form handler input fields.

from booking-js.

laander avatar laander commented on July 27, 2024

@riusi88
Makes good sense, thanks. If you want to get all the input fields from the form, you can also use the submitBookingForm callback as that gets an JS object with key/value pairs of all fields passed. It's however called when the user submits the form (and not when the API returns successful), but it might still work for you?

from booking-js.

ChrisChinchilla avatar ChrisChinchilla commented on July 27, 2024

@laander @riusi88 Sorry, my late reply means I have forgotten what I was doing here.

So you're saying that if I add custom fields they are accessible somewhere, I just have to implement myself? That's fine with me!

The event description is fine for our uses right now, seperate items would be great for some sort of export, but not essential at the moment.

from booking-js.

sbiefeni avatar sbiefeni commented on July 27, 2024

I tried adding fields in the bookingfields, but the fields do not show up on the resulting form. could someone give me an example of how you accomplished this?

from booking-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.