السلام عليكم
ماهو الخطأ في هذا الكود
عند فتح الصفحة اخر حقل لا يظهر وعند اختيار الدولة
يتم تحميل المدن الخاصة بالدولة المختارة ولاكن حقل الدولة لا يظل على الاختيار
مرفق الكود مع قاعدة البيانات
فزعتكم شباب
سلام
كود:<%@language=VBScript CodePage="1256"%> <html> <% Dim ConnectionString Dim AR ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; " & "Data Source=" & Server.MapPath("data.mdb") Set AR=Server.CreateObject("ADODB.Connection") AR.ConnectionString =ConnectionString AR.Open %> <% ip_address=(Request.ServerVariables("remote_addr")) country = request.form("country") info =request.form("info") City = request.form("City") %> <% Function AddF() addSQL= " insert into info (ip_address,info,City,country) values ('"&ip_address&"','"&City&"','"&country&"','"&info&"')" AR.execute(addSQL) %> <head> </head> <body> <p><font face="Times New Roman" size="3">Thank you...</font></p> <% End Function %> <% If info="" then response.write "خطأ .. يجب اكمال جميع البيانات في الحقول" Else AddF() End If %> <p align="center"><b><font face="Times New Roman" size="7" color="#C11111">add info </font></b></p> <form name=frmAdd method="POST" action="citycountry.asp"> <p><b>Country </b><b>: </b> <% Set objRS = AR.Execute("Select * FROM country order by ID") %> <SELECT NAME="country" SIZE="1" ONCHANGE=frmAdd.submit()> <% ' Continue until we get to the end of the recordset. Do Until objRS.EOF ' For each record we create a option tag and set it's value to the country %> <option value= <%=objRS("ID")%>><%=objRS("country")%></OPTION> <% ' Get next record objRS.MoveNext Loop %> <% objRS.Close %> </SELECT> </p> <p><b>City </b><b>: </b> <SELECT NAME="City" SIZE="1"> <% Set objRs = AR.Execute("Select * FROM City where Country = " & Request.Form ("country") & " order by ID") %> <% ' Continue until we get to the end of the recordset. Do Until objRs.EOF ' For each record we create a option tag and set it's value to the country %> <OPTION value= <%=objRs("ID")%>><%=objRs("City")%></OPTION> <% ' Get next record objRs.MoveNext Loop %> </SELECT> </p> <p><b>Info </b><b>:</b></p> <p><b> <textarea rows="11" name="info" cols="78"></textarea></b></p> <p><input type="submit" value="Add" name="add"></p> </form> <% ' Close Data Access Objects and free DB variables objRS.Close Set objRS = Nothing AR.Close Set AR = Nothing %> </body> </html>



