John Marshall 8 Posted July 29, 2016 Report Share Posted July 29, 2016 Hi, How would you go about creating this simple program: 1. User inputs several keywords to a text area. 2. Program removes all spaces and line breaks and replaces them with a comma. 3. Program displays the new list of comma separated keywords within the same text area that the user used in 1. 4. User is able to copy the list of keywords to their clipboard. Some ideas about how I could get started creating this would be appreciated. John Quote Link to post Share on other sites
nichewebstrategies 12 Posted July 29, 2016 Report Share Posted July 29, 2016 If you are interested in a JavaScript only solution, give this a try: ui html panel("<!DOCTYPE html> <html> <head> <script type=\"text/javascript\" src=\"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.1.0.min.js\"></script> <script type=\"text/javascript\" src=\"https://cdn.jsdelivr.net/clipboard.js/1.5.12/clipboard.min.js\"></script> </head> <body> <textarea data-clipboard-text=\"\" id=\"txtWords\" cols=\'50\' rows=\'10\'></textarea> <button id=\"btnReplace\">Replace Words</button> <button id=\"btnCopyToClipboard\" style=\"display:none;\">Copy To Clipboard</button> <script type=\"text/javascript\"> $(document).ready(function()\{ $(\"#btnReplace\").click(function()\{ $(\"#txtWords\").each(function()\{ this.value = this.value.replace(/(\\r\\n|\\n|\\r| )/gm,\",\"); \}); $(\"#txtWords\").select(); $(\"#btnCopyToClipboard\").click(); \}); var clipboard = new Clipboard(\'#btnCopyToClipboard\', \{ text: function() \{ return $(\"#txtWords\").val(); \} \}); clipboard.on(\'success\', function(e) \{ console.log(e); \}); clipboard.on(\'error\', function(e) \{ console.log(e); \}); \}); </script> </body> </html>",500) 1 Quote Link to post Share on other sites
John Marshall 8 Posted July 31, 2016 Author Report Share Posted July 31, 2016 Many thanks. I will look at your code. I'd also really be grateful for ideas about how I could get started making the software I described above using Ubot. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.