This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
We have this requirement. In the HTML form, there will be rows of lines. Each line contains multiple Input(type=text) boxes. Basically, HTML form will look like EXCEL Grid, where each column or row is a series of INPUT boxes.
Now, users will copy data from any EXCEL column and will paste that data into any input box. Then, our application should copy the data from first cell of the EXCEL to that input box, the data from second(copied) cell to the input box below the first and so on. In brief, they want to cut/copy and paste from EXCEL column to HTML column.
I tried many many ideas/tricks but did not find any useful one. Any help?
Regards to all, - Susanta
When you copy and paste an excel columns into the textbox, the columns are represented by tabs. So what I did was take the input, split it on the tabs and looped through the array and whamo.
Now if you want them to be able to post a bunch of rows at the same time and fill in a table. You can do it with a text area and splitting first on \r\n to get the rows and than on \t to get the tabs.
Hope that helps you out a bit. Eric
Joined: Aug 12, 2002
Eric, Thanks for replying.
We tried your approach of splitting the data on newline separator and distributing in the cells below. But, to do this, we have to work with textarea (as you mentioned and input[type=text] cannot handle that).
Joined: Nov 08, 2001
That is when: style="overflow:hidden" comes in handy
Joined: Aug 12, 2002
Eric, Thanks. That works. We successfully did a presentation to users using this technique and the HTML Grid design is a hit. Only trivial problem I found is that, in textarea, if you press enter then a new line is created in textarea (instead of form getting submitted as in case of input type=text box), as user may type something in those HTML grid.