hello everyone, I have a jsp that has the following fields on the form: 1. studentid 2.studentname 3.performance 4.class 5.teacher 5.principal. All the above fields information is stored in "student" table.
Teacher assigns the value to performance field for each student.This field can have any one of the three values: 1. Poor 2.Improving 3.Good
This form allows the user to add/edit student information in add/edit mode. During add mode, the student record is created. If there is change in that students information, the teacher edits that record data during edit mode. The principal can edit student information. Now my goal is to disable the studentid field when the student performance changes from either poor/improving to good for the first time.When that performance field has good as value in it, then that studentid field needs to be disabled and the teacher will not be able to change the value in that field even if the value in that field changes from good to poor/improving. Only the principal should have the ability to change the value in that performance field during edit mode.
For that I have created a flag_code field in student table.My idea is when the flag_code field has N value for the first time, we should lock that field from changing to Y when we change the value in the performance field.
int status1=0, status2 =0; int flagcount=0; String flag=""; String iStr1 = "",iStr2="";
//Modified Code:- strSQL=" select performance from "student" where upper(studentid)='"+studentid.toUpperCase()+"'";
The problem with my code is that I am unable to capture when the value changed to 3(good) either from 1 to 3 or 2 to 3.My code disabled the studentid field when the performance field has value 1 or 2 during edit mode before it changes to 3 for the first time. The goal is: The studentid field should be active during add mode. The field should also be active in edit mode as long as the performance field value changes from 1 to 2 and vice versa.Once the performance field changes from 1 or 2 to 3 for the first time, the studentid field should be blocked even though the value changes from 3 to either 1 or 2 during edit mode. Could anyone let me know how to solve this issue?