Hello,
I have a jsp page that has multi radio buttons and select boxes, and when the user finish selecting the choices, he will push the 'submit' button to complete the process.
Right now, if you press the 'submit' button it goes to an Exception Error.
Exception: com.EGTV.controller.RosterController: while formatting strFIdnullstrPersonId: nullstrAgencyId: nulljava.lang.NumberFormatException: null
I have been trying to get this javascript to work, but still it goes back to the error message wheather I only select only one choice or select none when I hit 'submit' .
Can you tell me where I have messed up?
Thanks,
Ngai
below is my code:
==========================================================
function formCheck() {
var error = "Error(s):\n\n";
var shift = document.Schedule.Shift.value;
var prisup = document.Schedule.PriSup.value;
var func = document.Schedule.FId.value;
var agency = document.forms["Schedule"].Agency;
var agencyVal = agency.options[agency.selectedIndex].value;
var person = document.forms["Schedule"].Person;
var personVal = person.options[person.selectedIndex].value;
if (error != "Error(s):\n\n") {
alert(Please complete form before submitting);
return false;
}
else if (shift == null) {
error += "Please complete form before submitting";
}
else if (prisup == null) {
error += "Please complete form before submitting";
}
else if (func == null) {
error += "Please complete form before submitting";
}
else if (agency == null) {
error += "Please complete form before submitting";
}
else if (agencyVal == null) {
error += "Please complete form before submitting";
}
else if (person == null) {
error += "Please complete form before submitting";
}
else if (personVal == null) {
error += "Please complete form before submitting";
}
}
<form name="Schedule" method="post" onSubmit="return formCheck()" action="<%= webappContextPath %>/Roster.do?><expresso:TransitionParamsTag name='UpdateSchedule'/>">
I have a jsp page that has multi radio buttons and select boxes, and when the user finish selecting the choices, he will push the 'submit' button to complete the process.
Right now, if you press the 'submit' button it goes to an Exception Error.
Exception: com.EGTV.controller.RosterController: while formatting strFIdnullstrPersonId: nullstrAgencyId: nulljava.lang.NumberFormatException: null
I have been trying to get this javascript to work, but still it goes back to the error message wheather I only select only one choice or select none when I hit 'submit' .
Can you tell me where I have messed up?
Thanks,
Ngai
below is my code:
==========================================================
function formCheck() {
var error = "Error(s):\n\n";
var shift = document.Schedule.Shift.value;
var prisup = document.Schedule.PriSup.value;
var func = document.Schedule.FId.value;
var agency = document.forms["Schedule"].Agency;
var agencyVal = agency.options[agency.selectedIndex].value;
var person = document.forms["Schedule"].Person;
var personVal = person.options[person.selectedIndex].value;
if (error != "Error(s):\n\n") {
alert(Please complete form before submitting);
return false;
}
else if (shift == null) {
error += "Please complete form before submitting";
}
else if (prisup == null) {
error += "Please complete form before submitting";
}
else if (func == null) {
error += "Please complete form before submitting";
}
else if (agency == null) {
error += "Please complete form before submitting";
}
else if (agencyVal == null) {
error += "Please complete form before submitting";
}
else if (person == null) {
error += "Please complete form before submitting";
}
else if (personVal == null) {
error += "Please complete form before submitting";
}
}
<form name="Schedule" method="post" onSubmit="return formCheck()" action="<%= webappContextPath %>/Roster.do?><expresso:TransitionParamsTag name='UpdateSchedule'/>">