Relationship between two custom module.

I have two custom moduls 1) state ,2) city ,city module is relate with state module ,
then i have one form with state and city selectin box ,
i went to when i select any state then city txtbox result give as selected state child citys only ,

and thanks in advance.

say if any solution about this relational type complication.