neda_barnamenevis
شنبه 29 تیر 1387, 08:57 صبح
سلام
من یک کد جاوا اسکریپت دارم
توی کد php وقتی یک موضوع انتخاب می کنم این زیر موضوع ها فال می شن مثلا اگر اولین موضوع را انتخاب کنیمdArray[1]انتخاب می شه
حالا من می خوام اگه ۲ تا موضوع انتخاب کردم ۲ تا زیر موضوع برام انتخاب بشه
function createList(nameID , listIndex , hidInputNameID , formNameID)
{
document.getElementById(nameID).length = 0
document.forms[formNameID][hidInputNameID].value = '';
var dArray = new Array()
dArray[1]=new Array('','Computational Fluid Dynamics','Experimental Aerodynamics','Subsonic Aerodynamics','High Speed Aerodynamics','Air Vehicle Aerodynamics','Rotary Wing Aerodynamics','Theoretical Aerodynamics','Aerodynamics Optimization','Inviscid and Viscous Flows','Solid & Fluid Interaction','Flow Control');
dArray[2]=new Array('','Combustion & Reacting Flow','Multi-phase Flows','Gas Turbine & Jet Engines','Acoustics','Turbomachinary','Propulsion Systems','Computational Fluid Dynamics','Heat Transfer','Internal Flow','Pollution & Control','Atmosphere');
dArray[3]=new Array('','Creep, Fatigue & Fracture','Destructive & Non-Destructive Tests','Structural Optimization','Composites','Buckling','Aeroelastic ity','Vibration','Experimental Stress Analysis','Computational Solid Mechanics','Nano and new Material','Solid & Fluid Interaction','Manufacturing Methods','Coating','Life Endurance & Estimation');
dArray[4]=new Array('','Flight Testing','Flight Simulation','Stability & Control','Spacecraft Control','Terrain Following & Navigation','Flight Supporting Structures','Non-linear modeling','Navigation','Modern controllers','Flight Design & Optimization','Air traffic','Sys identification');
dArray[5]=new Array('','Utilization','Transportation Systems','Navigation and Sensors','Orbital Dynamics, Perturbations and Stability','Attitude Dynamics, Determination and Control','Environmental Testing','Debris and Protection Systems','Innovative Design Techniques');
dArray[6]=new Array('','Strategic Management','Technology Management','Aerospace Project Management','Aerospace Regulations & Laws','Privatization','Flight Safety','Air transportation','Technology transfer','Aerospace Systems Performance Assessment','Forecasting','Operational Research');
dArray[7]=new Array('','Flight Propulsion Design','Ornitopters (Flapping Wing Air Vehicles)','Human-Powered Airplanes','Unmanned Air Vehicle','Aerospace System Design','Space System Design','Micro Air Vehicles','Micro & nano Systems','Design Philosophies');
for (var k=0 ; k < dArray
[listIndex].length;k++)
{
var elOptNew = document.createElement('option');
elOptNew.text = '' + dArray
[listIndex][k];
elOptNew.value = '' + dArray
[listIndex][k];
//elOptNew.value = k;
var elSel = document.getElementById(nameID);
try {
elSel.add(elOptNew, null);
}
catch(ex) {
elSel.add(elOptNew);
}
}
}
function setHiddenValue(hidInputNameID, selectedListIndex,formNameID,selectObject)
{
document.forms[formNameID][hidInputNameID].value = selectObject.options[selectedListIndex].text
}
من یک کد جاوا اسکریپت دارم
توی کد php وقتی یک موضوع انتخاب می کنم این زیر موضوع ها فال می شن مثلا اگر اولین موضوع را انتخاب کنیمdArray[1]انتخاب می شه
حالا من می خوام اگه ۲ تا موضوع انتخاب کردم ۲ تا زیر موضوع برام انتخاب بشه
function createList(nameID , listIndex , hidInputNameID , formNameID)
{
document.getElementById(nameID).length = 0
document.forms[formNameID][hidInputNameID].value = '';
var dArray = new Array()
dArray[1]=new Array('','Computational Fluid Dynamics','Experimental Aerodynamics','Subsonic Aerodynamics','High Speed Aerodynamics','Air Vehicle Aerodynamics','Rotary Wing Aerodynamics','Theoretical Aerodynamics','Aerodynamics Optimization','Inviscid and Viscous Flows','Solid & Fluid Interaction','Flow Control');
dArray[2]=new Array('','Combustion & Reacting Flow','Multi-phase Flows','Gas Turbine & Jet Engines','Acoustics','Turbomachinary','Propulsion Systems','Computational Fluid Dynamics','Heat Transfer','Internal Flow','Pollution & Control','Atmosphere');
dArray[3]=new Array('','Creep, Fatigue & Fracture','Destructive & Non-Destructive Tests','Structural Optimization','Composites','Buckling','Aeroelastic ity','Vibration','Experimental Stress Analysis','Computational Solid Mechanics','Nano and new Material','Solid & Fluid Interaction','Manufacturing Methods','Coating','Life Endurance & Estimation');
dArray[4]=new Array('','Flight Testing','Flight Simulation','Stability & Control','Spacecraft Control','Terrain Following & Navigation','Flight Supporting Structures','Non-linear modeling','Navigation','Modern controllers','Flight Design & Optimization','Air traffic','Sys identification');
dArray[5]=new Array('','Utilization','Transportation Systems','Navigation and Sensors','Orbital Dynamics, Perturbations and Stability','Attitude Dynamics, Determination and Control','Environmental Testing','Debris and Protection Systems','Innovative Design Techniques');
dArray[6]=new Array('','Strategic Management','Technology Management','Aerospace Project Management','Aerospace Regulations & Laws','Privatization','Flight Safety','Air transportation','Technology transfer','Aerospace Systems Performance Assessment','Forecasting','Operational Research');
dArray[7]=new Array('','Flight Propulsion Design','Ornitopters (Flapping Wing Air Vehicles)','Human-Powered Airplanes','Unmanned Air Vehicle','Aerospace System Design','Space System Design','Micro Air Vehicles','Micro & nano Systems','Design Philosophies');
for (var k=0 ; k < dArray
[listIndex].length;k++)
{
var elOptNew = document.createElement('option');
elOptNew.text = '' + dArray
[listIndex][k];
elOptNew.value = '' + dArray
[listIndex][k];
//elOptNew.value = k;
var elSel = document.getElementById(nameID);
try {
elSel.add(elOptNew, null);
}
catch(ex) {
elSel.add(elOptNew);
}
}
}
function setHiddenValue(hidInputNameID, selectedListIndex,formNameID,selectObject)
{
document.forms[formNameID][hidInputNameID].value = selectObject.options[selectedListIndex].text
}