NET移植案例学习:建造Web站点(7)
程序员文章站
2024-01-30 11:37:34
图5 客户端的验证逻辑
formsubmittest(problemtitle,bugdescription,buildversion,cboproduct,
a...
图5 客户端的验证逻辑
formsubmittest(problemtitle,bugdescription,buildversion,cboproduct,
applanguage,cboarea, cbosubarea,severity,build)
{
var ig;
var renl = " " + " ";
ig = 0;
resetarrowsize();
if (problemtitle.value == "" ){
document.images.item("arrowprobtitle").width=8
ig++
}
if (buildversion.value == -1){
document.images.item("arrowbuildversion").width=8
ig++
}
if (buildversion.value == ""){
document.images.item("arrowbuildversion").width=8
ig++
}
if (applanguage.value == -1){
document.images.item("arrowapplanguage").width=8
ig++
}
if (cboproduct.value == ""){
document.images.item("arrowproductname").width=8
ig++
}
if (cboarea.value == ""){
document.images.item("arrowproblemarea").width=8
ig++
}
if (cbosubarea.value == ""){
document.images.item("arrowproblemsubarea").width=8
ig++
}
if (severity.value == -1){
document.images.item("arrowseverity").width=8
ig++
}
if (bugdescription.value == "problem description:" + renl + renl +
"steps to reproduce:" + renl + renl + "expected behavior:"
+ renl + renl + "actual behavior:"+ renl + renl + renl){
document.images.item("arrowdescription").width=8
ig++
}
if (bugdescription.value == ""){
document.images.item("arrowdescription").width=8
ig++
}
if (ig != 0){
alert("you are missing one or more of the required items
(indicated by the red arrow) needed to submit this form.")
return false;
}
else{
if (document.form1.bugdescription.value == "")
{
// dont submit
alert("please enter a problem description.")
return false;
}
else{
if (document.form1.bugdescription.value == "problem
description:
steps to reproduce: expected behavior: actual
behavior:")
{
// dont submit
alert("please enter a problem description.")
return false;
}
else{
var buildval = build.value;
var buildlen = buildval.length;
file://alert(buildlen);
if (buildlen <= 0)
{
var typ = buildversion.type;
if (typ == "text") file://build is a text box
{
var val = buildversion.value;
var len = val.length;
if ((isnan(val)) || (len != 4))
{
// dont submit
alert("please enter build using the
format nnnn.")
return false;
}
else
{
// concatenate the build number with
"07.00.00."
buildversion.value = "07.00.00." +
buildversion.value
// submit
document.form1.method = "post"
document.form1.action = "lamegeneral."
return true;
}
}
else
{
// submit
document.form1.method = "post"
document.form1.action = "lamegeneral.asp"
return true;
}
}
}
}
}
}
图6 在报告时选择产品的版本
formsubmittest(problemtitle,bugdescription,buildversion,cboproduct,
applanguage,cboarea, cbosubarea,severity,build)
{
var ig;
var renl = " " + " ";
ig = 0;
resetarrowsize();
if (problemtitle.value == "" ){
document.images.item("arrowprobtitle").width=8
ig++
}
if (buildversion.value == -1){
document.images.item("arrowbuildversion").width=8
ig++
}
if (buildversion.value == ""){
document.images.item("arrowbuildversion").width=8
ig++
}
if (applanguage.value == -1){
document.images.item("arrowapplanguage").width=8
ig++
}
if (cboproduct.value == ""){
document.images.item("arrowproductname").width=8
ig++
}
if (cboarea.value == ""){
document.images.item("arrowproblemarea").width=8
ig++
}
if (cbosubarea.value == ""){
document.images.item("arrowproblemsubarea").width=8
ig++
}
if (severity.value == -1){
document.images.item("arrowseverity").width=8
ig++
}
if (bugdescription.value == "problem description:" + renl + renl +
"steps to reproduce:" + renl + renl + "expected behavior:"
+ renl + renl + "actual behavior:"+ renl + renl + renl){
document.images.item("arrowdescription").width=8
ig++
}
if (bugdescription.value == ""){
document.images.item("arrowdescription").width=8
ig++
}
if (ig != 0){
alert("you are missing one or more of the required items
(indicated by the red arrow) needed to submit this form.")
return false;
}
else{
if (document.form1.bugdescription.value == "")
{
// dont submit
alert("please enter a problem description.")
return false;
}
else{
if (document.form1.bugdescription.value == "problem
description:
steps to reproduce: expected behavior: actual
behavior:")
{
// dont submit
alert("please enter a problem description.")
return false;
}
else{
var buildval = build.value;
var buildlen = buildval.length;
file://alert(buildlen);
if (buildlen <= 0)
{
var typ = buildversion.type;
if (typ == "text") file://build is a text box
{
var val = buildversion.value;
var len = val.length;
if ((isnan(val)) || (len != 4))
{
// dont submit
alert("please enter build using the
format nnnn.")
return false;
}
else
{
// concatenate the build number with
"07.00.00."
buildversion.value = "07.00.00." +
buildversion.value
// submit
document.form1.method = "post"
document.form1.action = "lamegeneral."
return true;
}
}
else
{
// submit
document.form1.method = "post"
document.form1.action = "lamegeneral.asp"
return true;
}
}
}
}
}
}
图6 在报告时选择产品的版本
上一篇: Up.aspx C#版