Modal Window and Data Manipulation

Asked

Viewed 868 times

0

I have the following question:

I am working on a project where I have a registration form and I 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 a button that opens a modal (loads another php page) inside the modal loads the google maps and a field with the address, after the user specifies the address and click insert back into the form with the completed address.

I already got 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 carry a modal with this page of mine .php (cad_novo.php) and how to pass the data to the form and auto impute in the address field to then do 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 don’t understand Ajax, but if it’s an option I try to learn.

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

  • see my answer: http://answall.com/questions/83066/vari%C3%A1vel-php-inside-modal

1 answer

0

There are several ways to do this... I will expose a.

Let’s imagine the buttons (Residential End) and (Commercial End.) The one-click user (Residential End) then opens a modal with a form inside it (Formresidencial) the user fills in and a record.

Good,... in the record you take the form information (Formresidencial) and write to the database and trigger a function with Jquery to store the data filled in (Formresidencial) and a show in a div of yours with these fields and a replace of inputs by the previously filled value.

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

Example jQuery.... (input value comes from a hidden span) http://jsfiddle.net/fellipesousa/ZW5dC/

  • It might work, but what I need is to sort of pass the value of the child window on to the father. I am now seeing if I can use an iframe to do this interaction. Still I appreciate the willingness to help =)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.