Changeset 1638
- Timestamp:
- May 7, 2012, 1:41:31 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/resources/partitionform.jsp
r1628 r1638 40 40 var apWeightsAreValid; 41 41 var hisWeightsAreValid; 42 var oneOrMoreWeightsAreSet;42 var allWeightsAreValid; 43 43 var nofPiecesAreValid; 44 44 var isRestoringFromLocalStorage = false; // A flag to keep track of what is happening … … 104 104 return false; 105 105 } 106 if ( oneOrMoreWeightsAreSet[i] == false)106 if (allWeightsAreValid[i] == false) 107 107 { 108 108 return false; … … 183 183 hisWeightsAreValid = Array(); 184 184 nofPiecesAreValid = Array(); 185 oneOrMoreWeightsAreSet= Array();185 allWeightsAreValid = Array(); 186 186 187 187 for (var i=0;i<selectedTubes.length;i++) … … 191 191 hisWeightsAreValid[i] = true; 192 192 nofPiecesAreValid[i] = false; 193 oneOrMoreWeightsAreSet[i] = false;193 allWeightsAreValid[i] = false; 194 194 } 195 195 … … 315 315 function isNumberKey(evt) 316 316 { 317 return true; 317 318 evt = (evt) ? evt : ((window.event) ? event : null); 318 319 if (evt) { … … 458 459 var apWeightValue = frm.elements['apWeight'+tubeIndex].value; 459 460 var hisWeightValue = frm.elements['hisWeight'+tubeIndex].value; 460 if (spWeightValue == '' && apWeightValue == '' && hisWeightValue == '') 461 { 462 oneOrMoreWeightsAreSet[tubeIndex] = false; 463 setInputStatus(tubeIndex, 'No weight is defined.', 'invalid'); 464 return; 465 } 466 oneOrMoreWeightsAreSet[tubeIndex] = true; 467 setInputStatus(tubeIndex, '', 'valid'); 468 } 469 461 462 if (apWeightValue == '') 463 { 464 allWeightsAreValid[tubeIndex] = false; 465 setInputStatus(tubeIndex, 'No ApWeight is defined.', 'invalid'); 466 } 467 else if (hisWeightValue == '' && spWeightValue != '') 468 { 469 allWeightsAreValid[tubeIndex] = false; 470 setInputStatus(tubeIndex, 'SpWeight is set but not HisWeight', 'invalid'); 471 472 } 473 else 474 { 475 allWeightsAreValid[tubeIndex] = true; 476 if (apWeightValue == '0') 477 { 478 setInputStatus(tubeIndex, 'No Lysate item will be created!', 'warning'); 479 } 480 else if (hisWeightValue == '0') 481 { 482 setInputStatus(tubeIndex, 'No Histology item will be created!', 'warning'); 483 } 484 else 485 { 486 setInputStatus(tubeIndex, '', 'valid'); 487 } 488 } 489 490 } 491 492 //Check the SpWeight value -- empty or >= 0 are ok. 470 493 function spWeightOnChange(tubeIndex) 471 494 { … … 473 496 var frm = document.forms['reggie']; 474 497 var weightInput = frm.elements[inputName].value; 475 if (weightInput != '') 476 { 477 if (weightInput < 0) 478 { 479 spWeightsAreValid[tubeIndex] = false; 480 updateInputStatus(tubeIndex); 481 return; 482 } 483 if (weightInput == '0') 484 { 485 frm.elements[inputName].value = ''; 486 } 487 } 488 spWeightsAreValid[tubeIndex] = true; 498 if (weightInput == '' || parseFloat(weightInput) >= 0) 499 { 500 spWeightsAreValid[tubeIndex] = true; 501 } 502 else 503 { 504 spWeightsAreValid[tubeIndex] = false; 505 } 489 506 updateInputStatus(tubeIndex); 490 507 } 491 508 509 // Check the ApWeight value -- empty or >= 0 are ok. 492 510 function apWeightOnChange(tubeIndex) 493 511 { … … 495 513 var frm = document.forms['reggie']; 496 514 var weightInput = frm.elements[inputName].value; 497 if (weightInput != '') 498 { 499 if (weightInput < 0) 500 { 501 apWeightsAreValid[tubeIndex] = false; 502 updateInputStatus(tubeIndex); 503 return; 504 } 505 if (weightInput == '0') 506 { 507 frm.elements[inputName].value = ''; 508 } 509 } 510 apWeightsAreValid[tubeIndex] = true; 515 if (weightInput == '' || parseFloat(weightInput) >= 0) 516 { 517 apWeightsAreValid[tubeIndex] = true; 518 } 519 else 520 { 521 apWeightsAreValid[tubeIndex] = false; 522 } 511 523 updateInputStatus(tubeIndex); 512 524 } 513 525 526 //Check the HisWeight value -- empty or >= 0 are ok. 514 527 function hisWeightOnChange(tubeIndex) 515 528 { … … 517 530 var frm = document.forms['reggie']; 518 531 var weightInput = frm.elements[inputName].value; 519 if (weightInput != '') 520 { 521 if (weightInput < 0) 522 { 523 hisWeightsAreValid[tubeIndex] = false; 524 updateInputStatus(tubeIndex); 525 return; 526 } 527 if (weightInput == '0') 528 { 529 frm.elements[inputName].value = ''; 530 } 531 } 532 hisWeightsAreValid[tubeIndex] = true; 532 if (weightInput == '' || parseFloat(weightInput) >= 0) 533 { 534 hisWeightsAreValid[tubeIndex] = true; 535 } 536 else 537 { 538 hisWeightsAreValid[tubeIndex] = false; 539 } 533 540 updateInputStatus(tubeIndex); 534 541 }
Note: See TracChangeset
for help on using the changeset viewer.