本文介绍了如何根据另一个列表项和数据库的选定项更改下拉列表的列表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的程序员,

我正在为计算机学院制作学生注册表。我有两个下拉列表,一个用于讲座,另一个用于可用课程。我在数据库1表中创建了两个表,当他点击提交时保存学生的所有信息,另一个是课程表。

课程表的结构是:

lectTime ---------- SoftwareLab ----------- HardwareLab

MondayAM ------- MSoffice --- ------------ NULL

TuesdayAM ------- C语言------------ BasicHardware

WednesdayAM ---- MSoffice --------------- CCNA

MondayPM ------- VisualBasic -------- ---- Null

ThursdayPM ----- Null -------------------基本硬件



在我的第一个下拉列表中(即讲座)我有我所有的讲课时间(星期一,星期二,星期三,星期一和星期四)。现在我的要求是如果用户选择任何讲座 - 对于Ex:MondayAM,然后在另一个下拉列表中它应该是可用课程(MS-office),如果选择TuesdayAM那么它应该显示两个值(C-Language,BasicHardware)。 />


另一项要求是在我的注册表中,它不应允许每天每门课程插入超过20条记录。(例如,MondayAM-MSoffice只允许20名学生,TuesdayAM-C-Language 20名学生和BasiHardware 20名学生允许)。



任何人都可以用代码解决这个问题。



提前致谢

Dear Programmers,
I am making a student registration form for a computer institute. In which I have two dropdown lists, one is for lecturetimings and another is for availablecourses. I made two tables in database 1 table will save all the information of student when he clicks on submit, another is courses table.
The structure of courses table is:
lectTime ----------SoftwareLab-----------HardwareLab
MondayAM-------MSoffice---------------NULL
TuesdayAM-------C-Language------------BasicHardware
WednesdayAM----MSoffice---------------CCNA
MondayPM-------VisualBasic------------Null
ThursdayPM-----Null-------------------Basic Hardware

In my first dropdown list(i.e "lecturetimings") I have all my lecture timings(MondayAM, TuesdayAM,WednesdayAM, MondayPM and ThursdayPM). Now my requirement is if a user selects any lecturetimings-for Ex:MondayAM, then in another dropdown list it should available course(MS-office), if selectes TuesdayAM then it should show two values(C-Language, BasicHardware).

And another requirement is in my register table it should not allow to insert more than 20 records for each course of each day.(For example MondayAM-MSoffice only 20 students are allowed, TuesdayAM-C-Language 20 students and BasiHardware 20 students allowed).

Anyone kindly solve this with the code.

Thanks in advance

推荐答案



这篇关于如何根据另一个列表项和数据库的选定项更改下拉列表的列表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 19:29