Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Cynthia Tiwana 9 posts 89 karma points
    May 12, 2017 @ 16:12
    Cynthia Tiwana
    0

    Be able to use multiple types of time appointments on the form

    I'm wondering if anyone has tried implementing some modifications on the scheduling side of things.

    What I'm wanting to do is set up a checkbox on the form, if unchecked, the appointment time would be 15 minutes, if checked, then 30 minutes, or perhaps be able to select two adjacent slots if available.

    Any starting points? I started reading through the documentation and thought I should get some advice.

  • Cimplex 113 posts 576 karma points
    May 16, 2017 @ 06:36
    Cimplex
    0

    Hi Cynthia,

    I'm not to sure how to solve this on the client side, maybe you could add some external js code that hide every other value in the time dropdown menu or something like that.

    If you follow this guide: http://www.ubooking.org/support/documentation/tutorials/custom-controller/

    In the action, add a FormCollection parameter lets call it collection.

    public ActionResult HandleForm(BookingViewModel model, FormCollection collection)
    

    In the razor form you add a dropdown menu, like this:

    <select name="Appointment">
     <option value="">Standard appointment</option>
     <option value="30">Longer appointment</option>
    </select>
    

    Serverside:

    var booking = bookingHandler.GenerateBooking();
    booking = bookingService.Create(booking);
    
    if(collection["Appointment"] == "30") {
     booking.LeavingDate = booking.LeavingDate.AddHours(15);
    }
    

    I have not tested this but it may work. At least it might give you some ideas.

    // Herman

Please Sign in or register to post replies

Write your reply to:

Draft