addPayout = function(idInstrument) { //alert( 'add Payout' ); var idForm = '#add_payout_form_' + idInstrument; var oAddForm = $( idForm ); //alert( $( idForm ) ); namePortfolio = oAddForm.find( "input:hidden[name=namePortfolio]" ).val(); idNotation = oAddForm.find( "input:hidden[name=idNotation]" ).val(); idInstrument = oAddForm.find( "input:hidden[name=idInstrument]" ).val(); amountPayout = oAddForm.find( "input:text[name=amountPayout]" ).val(); datePayout = oAddForm.find( "input:text[name=datePayout]" ).val(); idTypePayout = oAddForm.find( "select[name=idTypePayout] option:selected" ).val(); $.ajax( { url: '/IBT-BA-HP/extended_portfolio2/ajax_payout_modify.html' + '?NAME_PORTFOLIO=' + namePortfolio + '&ID_NOTATION=' + idNotation + '&AMOUNT_PAYOUT=' + amountPayout + '&DATE_PAYOUT=' + datePayout + '&ID_TYPE_PAYOUT=' + idTypePayout + '&ID_INSTRUMENT=' + idInstrument + '&ACTION=ADD', success: function(){ window.location = '/IBT-BA-HP/extended_portfolio2/view.html?forward=overview&NAME_PORTFOLIO=' + namePortfolio; } } ); return false; } removePayout = function( idPayout, idInstrument, namePortfolio ){ $.ajax( { url: '/IBT-BA-HP/extended_portfolio2/ajax_payout_modify.html' + '?NAME_PORTFOLIO=' + namePortfolio + '&ID_PAYOUT=' + idPayout + '&ID_INSTRUMENT=' + idInstrument + '&ACTION=DELETE', success: function(){ window.location = '/IBT-BA-HP/extended_portfolio2/view.html?forward=overview&NAME_PORTFOLIO=' + namePortfolio; } } ); } generalSearch = function( oForm ){ var oSearchValue = oForm.find( ':input[name=searchValue]' ); if( oSearchValue.length == 0 ) oSearchValue = oForm.find( ':input[name=searchValueAdvanced]' ); var sSearchValue = oSearchValue.val(); sSearchValue = $.trim( sSearchValue ); if( typeof( sSearchValue ) == 'undefined' ){ alert( 'Please enter at least 3 characters into the searchfield' ); oSearchValue.focus(); } else if( sSearchValue == "" ){ alert( 'Empty String.' ); oSearchValue.focus(); } else if( sSearchValue.length < 3 ){ alert( 'Please enter at least 3 characters into the searchfield' ); oSearchValue.focus(); } else{ oForm.submit(); } } // Confirm of deleting the selected portfolio removePortfolio = function( name ){ if(window.confirm("Delete the portfolio '" + name + "'?")){ window.location = "/IBT-BA-HP/extended_portfolio2/modify.html?namePortfolio=" + name + "&action=DELETE&redirect=delete"; return true; } else { return false; } }