Comments (9)
@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.
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.
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.
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.
@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.
@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.
@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.
@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.
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)
- I need help!! HOT 1
- Fetch availability not working properly HOT 1
- Link in description is no longer available
- Blur focus on booking form when user clicks submit
- Prevent Booking without validation
- Available slots are different in Desktop vs Mobile HOT 2
- Limit bookings 1 per day
- "Book it" button colour
- Google Calendar not Syncing
- node-sass version issue (Old)
- Cant find Jquery in Ionic app HOT 1
- how to add meta data to the booking object
- 5 minutes of buffer time between appointment
- Show availability from a subset of project resources
- jQuery 3.5.1 incompatibility HOT 2
- Only one instance on a page will respond to callbacks
- Not working with SSR using Next JS HOT 1
- How to override the rendered `booked-email` element?
- No way of prefilling a select field.
- mutual mode booking how to add participants
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from booking-js.