3 Replies Latest reply on Mar 17, 2014 1:39 PM by Doolius

    Add commas between values in textbox


      Problem: Users need to be able to paste values into a text box and/or textarea and click a button that will take those values and show them the output with commas inserted.



      User Input







      other situation

      Is there a way to compare the values to a list created from table values and parse that way? this is different from above because the values might have spaces but still be the same value.



      User Input

      this is value one

      this is value two

      this is value three


      this is value one, this is value two, this is value three


      So for that I would want to take what the user input, and try and match it to different values in a certain column in my table if that makes sense

        • 1. Re: Add commas between values in textbox


          you can do this by using JavaScript on button click write a function to concatenate values and commas

          sample code

          function myFunction()
          document.getElementById("id").value=document.getElementById("id1").vlaue +','+document.getElementById("id2").vlaue+','

          and also you can compre the values in JavaScript.




          • 2. Re: Add commas between values in textbox

            Hi Steven,


            In case of your first example, we can create a computation after submit and replace the space with comma then try to insert into table by splitting the values based on comma in the process (after submit) as per your requirement.

            In case of second example, we can't do computation to replace the space with comma since the values are in sentence form. Why can't you educate your user to add comma in each and every sentence, then it will be easy to insert into the table using pl/sql code in process.


            please let me know if your doubts on this.




            • 3. Re: Add commas between values in textbox

              I received an answer for what I was wanting to accomplish on one of my other forum questions:



              But I don't know if it will work with the spaces yet.


              Lakshmi, the users currently do insert commas where needed before they search. But it is sometimes time consuming because they copy everything from a spreadsheet and at times could be copying 30+ values and they don't like to have to go through all of them and insert a comma where necessary.


              Thanks for the help