الكود الأساسي:
<title> تعديل الدُفعات ASP وحذف عملية الحذف مثال </title> <٪ if request.form (op) = update ثم 'IDS STIRCE = request.form (ids) إذا كانت ids <> ثم معرف الاستجابة. يتم حذفها: & ids & <br> '============ حالة حذف قاعدة البيانات conn.execute (حذف من xxx حيث المعرف في (& ids &) "الانتباه إلى القيام بالتحقق من الأمان بنفسك هذا المعرف عبارة عن مجموعة أرقام ، يمكنك جعل حكم Regexp منتظمًا بنفسك صلاحية ، النمط هو ^/d+(،/d+) 1 ل عبور الصفوف لكل صف من معرف البيانات = request.form (id) .Item (i) & name = request.form (name) .item (i) sex = request.form (sex) .item (i) age = طلب. : & id & | & name & | method = post onsubmit = return check (this)> <input type = hidden name = ids /> <!-تستخدم لتخزين مجموعة المعرف لحذف السجل-> <إدخال type = hidden name = op value = update / > <table border = 1 id = tb> <tr> <th> name </h> <th> الجنس </th> <th> العمر </th> <th> العنوان </th> <th> حذف < / th> </tr> <! ----------------------------------------- ------------------------------------------------- ------------------------------------------------- ------------------------------------------------- ------------------------------------------------- ------ tr> <td> <إدخال نوع = text value = name1 name = name /> </td> <td> <input type = text value = gender1 name = sex /> </td> <td> <type type = text value = age1 name = age /> </td> <td> <type type = text value = address1 = addr / > </td> <td> <type type = button value = delete onClick = RemoverOw (this)/> <input type = hidden name = id value = 1/> </td> </r> <tr> <td > <إدخال نوع = text value = name2 name = name /> </td> <td> <type type = text value = gender2 name = sex /> </td> <td> <type type = text value = age2 name = age/> </td> <td> <type type = text value = address2 name = addr/> </td> <td> < نوع الإدخال = قيمة الزر = حذف onClick = Removerow (this)/> <type type = hidden name = id value = 2/> </td> </tr> <! -------------- ليتم تعديل نهاية مثال البيانات --------> <TR> <td colspan = 5 align = center> <إدخال نوع = addRow () /> </td> </tr> </table> </form> <script type = text/javaScript> Removerow (btn) {if (تأكد ('تأكيد لحذف؟ ! ')) {var tr = btn.parentnode.parentNode ؛ المتصفحات القياسية .value! = '') {// delete عبارة عن صف موجود بدلاً من جديد ، ثم يتم تخزين المعرف في ids btn.ids.value += (btn.form.ids.value == ' '' ':' ، id.value ؛ document.getElementById ('tb') ، tr = tb.insertrow (tb.rows.length - 1) ، td = tr.insertcell (0) ؛ td = tr.insertcell (1) ؛ '؛ اكتب = اسم النص = addr /> '؛ '؛ // إضافة معرف خط البيانات الجديد فارغ} check (f) {var tb = document.getElementById (' tb ') ، ipts ؛ <J ؛ TB.ROWS [i]. ') ؛ خطأ ؛ ") {تنبيه (الرجاء إدخال العنوان!") ؛