kngoc7
asked on
JSP is causing error in my form
I have jsp form with a label and drop down box.
There is a radio button for a user to select their institution U = University T = technical school. There is a drop down box for ONLY technical students. It must not appear for university students. Upon opening, getInst() is checked. If it is U, disable both the label and drop down box. Otherwise display them.
The user has the option to change their institution.
If a Univ student decides to change to technical, the drop down box and label must appear.
If a technical student decides to change to univ the drop down box and label must be disabled
enabling and Disabling the dropdown box works fine, the label is not I don't know why
the label used to work like this
<td align=left><FONT id="label1" class="smallbold">Technica l School:</FONT></td>
but when I added
<td align=left><FONT id="label1" class="smallbold"
<% if (institution.getInst.equal s("U")) { %> disabled <%} %> >
it stopped working
Why is this happening? How can I fix it?
If it cannot be fixed, is there another way to resolve it?
Thank you in advance for your help
here is my code
...
<form>
<%
// U = University T = technical school
// object inst
%>
//Radio button for technical school or University here, selecting it invokes: xxx(inst)
<tr>
<td align=left><FONT id="label1" class="smallbold"
<% if (inst.getInst.equals("U")) { %> disabled <%} %> >Technical School:</FONT>
</td>
<td><select name="theSchool" id="schoolID" width=10
<% if (inst.getInst.equals("U")) { %> disabled <%} %> >
<font class=smallbold>
<OPTION VALUE='1' SELECTED>Winston Churchill school
<OPTION VALUE='2' >Margaret Thatcher school
<OPTION VALUE='3' >Jon Richards School
</font>
</select>
</td>
</tr>
...
</FORM>
...
I also have javascript for a user to select manually select the instituion
function xxxx(inst) {
var classAttrString = document.all? 'className':'class';
if (inst == 'U') {
var theClass="smallbolddisable d";
document.form.theSchool.di sabled=tru e; // this works ok
updateLabel(classAttrStrin g, theClass) // not working
}
if (inst == 'T') {
var theClass="smallbold";
document.form.theSchool.di sabled=fal se; // this works ok
updateLabel(classAttrStrin g, theClass) // not working
}
}
function updateLabel(classAttrStrin g, theClass) {
// this code used to work
document.getElementById('l abel1').se tAttribute (classAttr String,the Class,0);
}
There is a radio button for a user to select their institution U = University T = technical school. There is a drop down box for ONLY technical students. It must not appear for university students. Upon opening, getInst() is checked. If it is U, disable both the label and drop down box. Otherwise display them.
The user has the option to change their institution.
If a Univ student decides to change to technical, the drop down box and label must appear.
If a technical student decides to change to univ the drop down box and label must be disabled
enabling and Disabling the dropdown box works fine, the label is not I don't know why
the label used to work like this
<td align=left><FONT id="label1" class="smallbold">Technica
but when I added
<td align=left><FONT id="label1" class="smallbold"
<% if (institution.getInst.equal
it stopped working
Why is this happening? How can I fix it?
If it cannot be fixed, is there another way to resolve it?
Thank you in advance for your help
here is my code
...
<form>
<%
// U = University T = technical school
// object inst
%>
//Radio button for technical school or University here, selecting it invokes: xxx(inst)
<tr>
<td align=left><FONT id="label1" class="smallbold"
<% if (inst.getInst.equals("U"))
</td>
<td><select name="theSchool" id="schoolID" width=10
<% if (inst.getInst.equals("U"))
<font class=smallbold>
<OPTION VALUE='1' SELECTED>Winston Churchill school
<OPTION VALUE='2' >Margaret Thatcher school
<OPTION VALUE='3' >Jon Richards School
</font>
</select>
</td>
</tr>
...
</FORM>
...
I also have javascript for a user to select manually select the instituion
function xxxx(inst) {
var classAttrString = document.all? 'className':'class';
if (inst == 'U') {
var theClass="smallbolddisable
document.form.theSchool.di
updateLabel(classAttrStrin
}
if (inst == 'T') {
var theClass="smallbold";
document.form.theSchool.di
updateLabel(classAttrStrin
}
}
function updateLabel(classAttrStrin
// this code used to work
document.getElementById('l
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER