Executing .php file in javascript

hye guys, i have 2 question.

  1. How do i execute .php file in javascript?
  2. how do i transfer data from .php file to another .php file? Example: in first.php file, i have an empty 2 text input. When i filled in the first text input, it will bring its value to another .php file to collect data from database by using that particular value. Then, i need to take the data which is from database just now in the second .php file to the first .php file AND put it in the 2nd text input. Can anyone suggest how can i do that? a simple code about this 2 .php file will do. Your skills is much appreciated. ^^

What you want is a cascading drop down effect

There are numerous examples/tutorials all over the internet, let us know if you run into trouble implementing one of them.

i’m not sure but can u give a very simple code that could explain the simple example i gave earlier? just a simple one.

The above site shows a demo that does a 3 select box cascade, the selection in box 1 affects box 2, the selection in box 2 affects box 3. It also has nice images that detail what is going on, so hopefully it helps you too.