Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8250397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:52:28+00:00 2026-06-07T23:52:28+00:00

I have an Appointment model, each instance of which has a Client . Here’s

  • 0

I have an Appointment model, each instance of which has a Client. Here’s my template for editing an appointment:

<form id="edit-appointment" name="appointment" class="mobile_friendly">
  <div class="field">
    <input type="text" name="start_time_ymd" id="start_time_ymd" value="<%= start_time_ymd %>" placeholder="Start Date">
    <input type="text" name="start_time_time" id="start_time_time" value="<%= start_time_time %>" placeholder="Start Time">
  </div>

  <div class="field">
    <input type="text" name="client_name" id="client_name" value="<%= client.name %>" placeholder="Client">
    <input type="hidden" name="client_id" id="client_id" value="<%= client.id %>" placeholder="Client ID">
  </div>

  <div class="field">
    <input type="text" name="client_phone" id="client_phone" value="<%= client.phone %>" placeholder="Phone">
  </div>

  <div class="field">
    <input type="text" name="notes" id="notes" value="<%= notes %>" placeholder="Notes">
  </div>

  <div class="actions">
    <input type="submit" value="Update Appointment" />
  </div>

</form>

<a href="#/index/<%= stylist_id %>">Back</a>

My problem is that my Client attributes aren’t being passed to the server correctly. The JSON object that gets passed to the server on save looks something like the following. Let’s pretend I have a client with phone number 555-555-5555 but I change it to 555-555-1234 and then submit the form:

{"appointment":
  {"start_time_ymd":"1/1/2000",
   "client_phone":"555-555-1234",
   "client":{"phone":"555-555-5555"}}

I’ve omitted a lot of irrelevant fields, but hopefully you see what I mean. I’ve changed client_phone from 555-555-5555 to 555-555-1234, but the client object in the JSON object has its phone number unchanged. I need to somehow change that phone number.

How do I make these fields – like the phone number field – actually “take” so they get passed to the server as part of the client object under appointment and not directly under appointment? I’m using Backbone-relational, if that makes a difference.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T23:52:30+00:00Added an answer on June 7, 2026 at 11:52 pm

    I was able to get it to work like this:

    class Snip.Views.Appointments.EditView extends Backbone.View
      template : JST["backbone/templates/appointments/edit"]
    
      events :
        "submit #edit-appointment" : "update"
    
      update : (e) ->
        e.preventDefault()
        e.stopPropagation()
    
        # THE ONLY CHANGE I MADE WAS TO ADD THIS LINE
        @model.attributes.client.phone = $("#client_phone").val()
    
        @model.save(null,
          success : (appointment) =>
            @model = appointment
            window.location.hash = "/#index/" + @model.attributes.stylist_id
        )   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Appointment model where each Appointment has a client_id . When an
I have an ActiveRecord Appointment model, which includes topic and time attributes. I would
I have an Appointment model, which can be created via different routes (from Tutor
I have a form, which is for scheduling an appointment. I give user 3
I have several Customer s who book Appointment s. Each Appointment has exactly one
I have an Application (an appointment manager) which lets the user create usercontrols in
In a django application I have the following model: class Appointment(models.Model): #some other fields
I have a django model for an appointment in a calendar that I am
I have an Appointment model, whose available_dates can include multiple dates (say, available in
I'm using Backbone with Backbone-relational. I have two models, Appointment and Client , where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.