»
EnglishFrenchVietnamese

Print - Items List script - JavaScriptBank.com

Full version: jsB@nk » Utility » Items List script
URL: https://www.javascriptbank.com/items-list-script.html

Items List script © JavaScriptBank.comJavascript can remember a list of several items you enter. Just enter an item and click 'Add to List'. When you are finished, click 'Show List' to see the entries.

Full version: jsB@nk » Utility » Items List script
URL: https://www.javascriptbank.com/items-list-script.html



JavaScript
<SCRIPT language="JavaScript"><!-- hide it ...function MakeArray( n ) {if( n <= 0 ) {this.length = 0;return this;}this.length = n;for( var i = 1; i <= n; i++ ) {this[ i ] = 0;}return this;}var history = new MakeArray( 15 );var index = 0;var cmmnd = 1;function f_store( sTR ) {var i;if( index >= history.length ) {for( i = 1; i < history.length; i++ )history[i-1] = history[i];index = history.length - 1;}history[ index ] = cmmnd + ":" + sTR;++cmmnd;++index;document.history.command.value="";}function f_print() {var allCmmnds, i;allCmmnds = "";for( i = 0; i < index; i++ )allCmmnds += history[i] + "\n";alert( allCmmnds );}// End --></SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<FORM name="history"><INPUT name="command" type="text" value="" size="20"><INPUT type="button" value="Add to List" onclick="f_store(document.history.command.value)"><INPUT name="history" type="button" value="Show List" onclick="f_print()"></FORM><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->