How to implement this?

Hi all,
I have a matrix related data stored in the database…
means,
I want to implement a select box, which displays the first column value.
based on the selection, the second select box will show that first column related fields only,in this select box…
and so on…

how to represent the data in a database?
and how to do this?

Thanking you…

I would use an Ajax based callback function for the “change” event. This is done in Javascript. Ajax will send your request to a page which in turn will retrieve the relevant information for the 2nd column.On success, you will have to process the response returned from Ajax, and populate the column in Javascript.

Stronger than dirt …

Thank you for your reply…
I want,
based on selection of first select box item,
the second and third will populate.

How to do this?

Can you give me an example to do this…

Thanking you…

I have something I’ve written with jQuerY:
I have a form with two select fields: ‘network select’ and ‘forum select’.
The following code is inside the “$(document).ready” function:


          $('#network_select').bind('change', function(){
            
            var network_url= $('#network_select').attr('value');
            if (network_url == ''){
              $('#forum_select').html('<option>No Network Selected</option>');
              return;
            }
            $('#forum_select').html('<option value="">loading...</option>');
            ajax_populate_forums(network_url);
          })


Following is the callback function “ajax_populate_forums”:


  function ajax_populate_forums(network_url){
    var escaped_url=encodeURIComponent(network_url);
    $.ajax({
        type: "GET",
        url: "netUtilities.rb",
        data: "func=5&category=" + escaped_url,
        success: function(msg) {
            $('#forum_select').html('<option value="">All Forums</option>');
           $('#forum_select').append(msg);
        }
    });
  }


The “msg” returned is a string that can be prepared using PHP echo commands.

with hierarchically related tables

Thank you for your reply…
Not like hierarchical data…
but it is relational data.
I have a table with 5 columns…

first column shows the main category. it is having 2 values only…
second to fifth are their properties, some are likely to be same upto 4th column…

based on the first selection of select box,(this contains the 2 column data), second select box will populate…

Now the problem is;

This is for one item selection…(means upto 4 columns) based on seletion i am getting the row id and related image will be displayed…

now based on first, second item selection will be populated…(same as first).
based on these two, third one will populate…
These there select box selections, how to tablet these data…
and show relevant columns data only…

Thanking you…