Allen Levings
Allen Levings

Reputation: 142

Transfer Form Responses to Another Form

So what I am trying to accomplish is this; I have people cold-calling potential customers. When the caller gets a potential client on the phone and has them interested, they transfer the client to a sales agent to seal the deal.

During the initial conversation, the cold-caller collects some info in a form I have online such as name, phone number, address, etc. I need the cold caller to be able to transfer those values to the sales agent when they pass the phone call over.

The cold-caller and the sales agent are in two different buildings across town from each other, and the sales agent uses an online form to collect data as well. Capturing the values is not the problem, it is the pass from one agent to another that I cannot figure out.

I thought maybe the cold-caller could post the form to a Google spreadsheet, but I do not know how to get those values to populate on the second form when the call is passed. I need the transfer to happen within a few seconds, so sending a URL with the captured values in an email won't work due to email being unreliable in the speed department.

Anyone have any thoughts on this? I can use HTML, jQuery, or whatever. I would need help if it has to be done in AJAX....

Thanks!

Upvotes: 0

Views: 67

Answers (3)

Will B.
Will B.

Reputation: 18426

Looks like you are wanting to use HTML5 and Javascript WebSockets to be able to push data from one browser to another.

Ajax requires polling, meaning a query has to ask the server for new information. This can be accomplished by saving and comparing the last updated timestamps from a session variable.

Websockets push data to a connected peer when it is updated allowing for data to automatically populate as it is submitted, much like a real-time chat system.

If you are stuck on PHP you should take a look at Ratchet since it is fairly straightforward and minimalistic to implement in comparison to many of the alternatives.

http://socketo.me/

Chat demo using ratchet http://socketo.me/demo

Add in a RDBMS to create, read, and update the data and you have a powerful real-time application.

Upvotes: 1

Deep
Deep

Reputation: 2512

Ok.

This is customer side:

Customer put data into form, send this data to server. Server must save this data for agent.

This is agent side:

Browser send check requests (maybe automatically, maybe agent need click some button) for new data from customers. If exists new data you should place this data into form on agent page.

Upvotes: 1

Deep
Deep

Reputation: 2512

$('#first-form').submit(function() {
    $.post('/another-destination', $(this).serialize(), function(r) {
        alert('Data sended to another destination!');
    });
    return true;
});

Upvotes: 1

Related Questions