الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

القائمه المنسدله

بدأه لمن تزرع الورد في 21 يونيو 2012 · 2 رد · 1,009 مشاهدة · في قسم البرمجة بــ Javascript
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

أريد حلا ل هذه المشكله صمتت فورم في html و أرسلته الى php أنا مبتدأه في هذا الامور و أتعلم بذاتي

مشكلتي انا عندي قائمتين منسدله : الاولى تتعلق بالكلية و القائمة المنسدله الثانيه تعلق بالتخصص

بما انه كل كلية لها تخصص تابع لها أريد متلا عند اختيار من القائمه المنسدله الاولى كلية الهندسه مثلا تتظهر لي القائمة المنسدله الثانيه فقط تخصص هندسة الحاسوب و الكهرباء و الاتصالات و المكاترونكس و باقي التخصصات لا تظهر عند اختيار كلية الهندسه و أريد تكرير العمليه نفسها على كل كليه هذا هو الكود

<html dir="rtl">

<head>

<meta http-equiv="Content-Language" content="ar-sa">

<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">

<title>معلوماتك الشخصيه</title>

</head>



<body   >
<img src="society1.png" align="center" >


<form method="POST" action="view.php">

	<table border="1" width="480" height="700" align="center" style="font-family: Tahoma; font-size: 8pt">

		<tr>

			<td width="130" align="center"   > <font size="2">اسم الطالب كما في سجلات الجامعة</font></td>

			<td width="181" align="center">

			<input type="text" name="_Name" size="20"></td>

		</tr>

		<tr>

			<td width="130" align="center"> <font size="2"> رقم التسجيل كما في سجلات الجامعه </font></td>

			<td width="181" align="center">

			<input type="text" name="_No" size="20"></td>

		</tr>


		<tr>

			<td width="130" align="center"> <font size="2">مكان السكن الحالي </font></td>

			<td width="181" align="center">

			<input type="text" name="_RECIDNET1" size="20"></td>

		</tr>


		<tr>

			<td width="130" align="center" size ="20" > <font size="2"> مكان السكن الدائم </font></td>

			<td width="181" align="center">

			<input type="text" name="_RECIDNET2" size="20"></td>

		</tr>


		 <tr>

			<td width="130" align="center" > <font size="2">الكلية </font></td>

			<td width="181" align="center">

			<select size="1" name="_select1">

			                     <option          selected>----</option>
                                <option  >االهندسة و التكنولوجيا  </option>
								<option  >العلوم التطبيقية  </option>
								<option >الادراة و الاقتصاد  </option>
								<option >التربية التكنولوجية </option>
								<option >التربية الرياضية </option>



			</select></td>

		</tr>




		 <tr>

			<td width="130" align="center"> <font size="2"> التخصص </font></td>

			<td width="181" align="center">

			<select size="1" name="_select2">


			    <option selected>----</option>
                                <option >هندسة الكهربائية</option>
								<option >هندسة الحاسوب</option>
								<option >هندسة الاتصالات</option>
								<option >الاتمتة الصناعية</option>
								<option >هندسة الميكاترونكس</option>
								<option >رياضيات تطبيقية</option>
								<option >كيمياء تطبيقية</option>
								<option >فيزياء تطبيقية</option>
								<option >التربية التكنولوجية</option>
								<option >التربية الرياضية</option>
								</select>


			</td>

		</tr>




		 <tr>

			<td width="130" align="center"> <font size="2">حدد المكان الذي تريد الخدمة فيه </font></td>

			<td width="181" align="center">

			<input type="radio" value="داخل الجامعة"   name="the_place_service">داخل الجامعة<br>

			<input type="radio" value="خارج الجامعة"   name="the_place_service" > خارج الجامعة
			</td>


		</tr>




		<tr>

			<td width="130" align="center"> <font size="2">اذا كنت تريد الخدمة خارج الجامعة حدد المكان الذي تريد ان تخدم بها</font></td>

			<td width="181" align="center">

			<input type="text" name="_outset" size="20"></td>

		</tr>

        <tr>

			<td width="130" align="center"> <font size="2">هذا أمر اختياري هل  ترغب في التبرع بوحدة دم حيث يتم احتساب 10 ساعات من مجمل 40 ساعه من الخدمه اذا تبرعت بوحدة دم </font></td>

			<td width="181" align="center">



			    <input type="radio" value="نعم "   name="blood_service">نعم<br> 

			<input type="radio" value="  لا "   name="blood_service">لا<br>
			</td>



		</tr>






        <tr>

			<td width="130" align="center"> <font size="2">الجوال</font></td>

			<td width="181" align="center">

			<input type="text" name="_jawwal" size="20"></td>


		</tr>



		 <tr>

			<td width="130" align="center"> <font size="2">الهاتف</font></td>

			<td width="181" align="center">

			<input type="text" name="_phone" size="20"></td>


		</tr>




		 <tr>

			<td width="130" align="center"> <font size="2"> Email </font></td>

			<td width="181" align="center">

			<input type="text" name="_email" size="20"></td>


		</tr>


		<tr>

			<td width="130" align="center"> <font size="2"> الملاحظات </td>

			<td width="181" align="right">

			<ul>

	 <li> <font size="2"> مساق خدمة المجتمع هو كأي مساق يسجل من خلال البوابة الكترونية  </font></li>

	 <li>     <font size="2">       المساق الزامي لطلبة البكالوريس بواقع 40 ساعه خدمة  </font></li>

	 <li>     <font size="2">            شكرا لكم دائرة الدراسات و التنمية المجتمعية  </font></li>
            </ul>





       </td>


		</tr>






        <tr>

			<td width="288" align="center" colspan="2">

			<input type="submit" value="ارســــال" name="send"></td>

		</tr>

	</table>

</form>



</body>



</html>

أتمنى منكم المساعده شكرا جزيلا

#3

إنظر لهذا المثال :

<!DOCTYPE html>
<head>
    <title>Demo</title>
    <script>

        var map_major_to_college = {
            "---------" : ["---------"],

            "College 1" : ["College 1 - Major 1", "College 1 - Major 2", "College 1 - Major 3"],
            "College 2" : ["College 2 - Major 1"],
            "College 3" : ["College 3 - Major 1", "College 3 - Major 2"]
        }

        function majors() {
            var select_college  = document.getElementById("select_college");
            var selection       = select_college.options[select_college.selectedIndex].value;
            var select_majors   = document.getElementById("select_majors");

            // delete all elements from the previous selection
            select_majors.options.length    = 0;

            for(var i = 0 ; i < map_major_to_college[selection].length ; i++)
                select_majors.options= new Option(map_major_to_college[selection]);

        }

</script>
</head>
<body>
    <form action="#" method="post">
        <select size="1" name="select_college" id="select_college" onchange="majors();">
            <option>---------</option>
            <option>College 1</option>
            <option>College 2</option>
            <option>College 3</option>
        </select>
        <select size="1" name="select_majors" id="select_majors">
            <option>---------</option>
        </select>
    </form>
</body>

ضع إسم الكلية في map_major_to_college المفتاح, وفي المصفوفة التابعة لهذا المفتاح ضع التخصصات.

مواضيع مشابهة