Changeset 497 for tapas/web/project
- Timestamp:
- 04/27/12 17:39:33 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tapas/web/project/formTapas_script.jsp
r496 r497 8 8 /** *********** CONTAINERS *********** **/ 9 9 this.containerForm = $( "#formulaire" ); 10 //this.containerErrors = $( "#errors" );11 10 this.containerErrors = $( "#errForm" ); 12 11 this.containerCenter = $( "#containerCenter" ); 13 12 this.containerTabs = $( "#tab" ); 14 13 14 /** *********** VARIABLES *********** **/ 15 15 this.jSonFileFormats = jsonFileFormats || null; 16 16 this.jSonYesNos = jsonYesNos || null; … … 23 23 this.numRequest = 1; 24 24 25 26 this.containerErrors.show();27 28 25 var submitButton = new Button( {value:tapasTexts["label.submitButton"], parent:this.containerCenter, id:"button_submit", className: "red_button", classNameText:"red_button_text", onClick:jQuery.proxy( this.onClickSubmit, this )} ); 29 26 this.addRequestButton = new Button( {value:tapasTexts["label.addButton"], parent:this.containerCenter, id:"button_add", className: "positive", onClick:jQuery.proxy( this.onClickAdd, this )} ); … … 33 30 this.createForm(); 34 31 this.tabActive = this.createTab(); 32 33 this.containerErrors.hide(); 35 34 }, 36 35 … … 118 117 if( !currentTime ) 119 118 currentTime = "00:00:00"; 119 // TODO : voir si besoin de convertir format des heures 120 120 // $( "#" + inputDateId ).val( this.timeConverter.format( currentTime ) ); 121 121 $( "#" + inputDateId ).val( currentTime ); … … 269 269 onClickSubmit: function() 270 270 { 271 //if( this.validFields() )272 //{273 if( confirm( tapasTexts["confirm"] ) )274 {275 this.containerErrors.hide();276 this.requestCreateXML();277 }278 //}271 if( this.validFields() ) 272 { 273 if( confirm( tapasTexts["confirm"] ) ) 274 { 275 this.containerErrors.hide(); 276 // this.requestCreateXML(); 277 } 278 } 279 279 }, 280 280 … … 282 282 onClickAdd: function() 283 283 { 284 //if( this.validFields() ) 285 if( true ) 286 { 287 this.containerErrors.hide(); 288 this.nbRequest++; 289 290 //tabs 291 $( ".tab_class" ).removeClass( "activated" ); 292 this.tabActive = this.createTab(); 293 this.numRequest = this.tabActive.numTab; 294 295 //formulaires 296 $( ".divAll" ).hide(); 297 this.createForm(); 298 299 this.updateButtons(); 300 } 284 this.containerErrors.hide(); 285 this.nbRequest++; 286 287 //tabs 288 $( ".tab_class" ).removeClass( "activated" ); 289 this.tabActive = this.createTab(); 290 this.numRequest = this.tabActive.numTab; 291 292 //formulaires 293 $( ".divAll" ).hide(); 294 this.createForm(); 295 296 this.updateButtons(); 301 297 }, 302 298 … … 304 300 onClickDel: function() 305 301 { 306 //if( this.validFields() ) 307 if( true ) 302 if( confirm( "pouet" ) ) 308 303 { 309 304 var numCurrent = this.numRequest; … … 696 691 validFields: function() 697 692 { 698 return ( 699 isSup( this.selectObservatories.getValue(), 0, tapasTexts["label.observatory"], tapasTexts["text.toselect"], this.containerErrors ) && 700 isDiff( this.selectSpectralUnits.getValue(), -1, tapasTexts["label.spectralUnit"], tapasTexts["text.toselect"] ) && 701 isValidRange( $( "#iminspectral_ranger" ).val(), $( "#imaxspectral_ranger" ).val(), this.selectSpectralUnits.getValue(), tapasTexts["label.spectralRange"], tapasTexts["text.badvalue"] ) && 702 isDeg( $( "#ide" ).val(), tapasTexts["label.ide"], tapasTexts["text.badvalue"] ) && 703 isValidNum( $( "#iza" ).val(), tapasTexts["label.iza"], tapasTexts["text.badvalue"] ) && isBetween( $( "#iza" ).val(), 0, 90, tapasTexts["label.iza"], tapasTexts["text.badvalue"] ) && 704 isValidNum( $( "#irp" ).val(), tapasTexts["label.resolution"], tapasTexts["text.badvalue"] ) && isSup( $( "#irp" ).val(), 1, tapasTexts["label.resolution"], tapasTexts["text.badvalue"] ) && 705 isValidNum( $( "#isr" ).val(), tapasTexts["label.ratio"], tapasTexts["text.badvalue"] ) && isSup( $( "#isr" ).val(), 1, tapasTexts["label.ratio"], tapasTexts["text.badvalue"] ) 706 ) 693 var testOk = isSup( this.selectObservatories.getValue(), 0 ); 694 if( !testOk ) 695 { 696 this.containerErrors.html( tapasTexts["label.observatory"] + " : " + tapasTexts["text.toselect"] ); 697 this.containerErrors.show(); 698 return false; 699 } 700 701 testOk = isDiff( this.selectSpectralUnits.getValue(), -1 ); 702 if( !testOk ) 703 { 704 this.containerErrors.html( tapasTexts["label.spectralUnit"] + " : " + tapasTexts["text.toselect"] ); 705 this.containerErrors.show(); 706 return false; 707 } 708 709 testOk = isValidRange( $( "#iminspectral_ranger" ).val(), $( "#imaxspectral_ranger" ).val(), this.selectSpectralUnits.getValue() ); 710 if( !testOk ) 711 { 712 this.containerErrors.html( tapasTexts["label.spectralRange"] + " : " + tapasTexts["text.badvalue"] ); 713 this.containerErrors.show(); 714 return false; 715 } 716 717 testOk = isDeg( $( "#ide" ).val() ); 718 if( !testOk ) 719 { 720 this.containerErrors.html( tapasTexts["label.ide"] + " : " + tapasTexts["text.badvalue"] ); 721 this.containerErrors.show(); 722 return false; 723 } 724 725 testOk = isValidNum( $( "#iza" ).val() ); 726 if( !testOk ) 727 { 728 this.containerErrors.html( tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 729 this.containerErrors.show(); 730 return false; 731 } 732 733 testOk = isBetween( $( "#iza" ).val(), 0, 90 ); 734 if( !testOk ) 735 { 736 this.containerErrors.html( tapasTexts["label.iza"] + " : " + tapasTexts["text.badvalue"] ); 737 this.containerErrors.show(); 738 return false; 739 } 740 741 testOk = isValidNum( $( "#irp" ).val() ); 742 if( !testOk ) 743 { 744 this.containerErrors.html( tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 745 this.containerErrors.show(); 746 return false; 747 } 748 749 testOk = isSup( $( "#irp" ).val(), 1 ); 750 if( !testOk ) 751 { 752 this.containerErrors.html( tapasTexts["label.resolution"] + " : " + tapasTexts["text.badvalue"] ); 753 this.containerErrors.show(); 754 return false; 755 } 756 757 testOk = isValidNum( $( "#isr" ).val() ); 758 if( !testOk ) 759 { 760 this.containerErrors.html( tapasTexts["label.ratio"] + " : " + tapasTexts["text.badvalue"] ); 761 this.containerErrors.show(); 762 return false; 763 } 764 765 testOk = isSup( $( "#isr" ).val(), 1 ); 766 if( !testOk ) 767 { 768 this.containerErrors.html( tapasTexts["label.ratio"] + " : " + tapasTexts["text.badvalue"] ); 769 this.containerErrors.show(); 770 return false; 771 } 707 772 }, 708 773
Note: See TracChangeset
for help on using the changeset viewer.