Modal Window and Data Manipulation

0

I have the following question:

I'm working on a project where I have a registration form and need to open a modal window to include an address in a form.

Example:

In my form I have 3 types of Address.

Home Address > The user clicks on a button that opens a modal (loads another php page) within the modal loads the google maps and a field with the address, after the user specifies the address and click insert back pro form with the filled address. / p>

I already have the page .php (cad_novo.php) that queries google maps and autocompletes the address and saves the selected address in a field.

I need to know how to load a modal with this my page .php (cad_novo.php) and how to pass the data to the form and auto impute in the address field to then make the submit with the address that the guy selected through google maps.

The idea is that it does not change the address and we always have the address that comes from google

I thought about doing this with javascript but I do not know if it is possible to manipulate the data in this way.

I do not understand Ajax, but if it is an option I try to learn.

Currently the site is being developed with cms joomla 3x.

    
asked by anonymous 13.04.2015 / 21:33

1 answer

0

There are several ways to do this ... I'll expose one.

Let's imagine the buttons (End.Residencial) and (End.Commercial) The user clicks (End.Residential) then opens a modal with a form inside it (FormResidential) the user fills in and gives a write.

Well, in recording, you get information from the form (FormResidential) and write to the database and trigger a function with Jquery to store the data in the (FormResidential) and a show on a div with these fields and a replace of the inputs by the value previously filled in.

It is a solution, but as I said there are several and much better than it is.

Example jQuery .... (the input value comes from a hidden span) link

    
13.04.2015 / 21:57