Link to home
Start Free TrialLog in
Avatar of scbauer
scbauer

asked on

Create form that accepts "pasting" from excel

Hey everybody, I don't know if this is posted in the right area, but I'm going to give it a shot.  I am trying to build a web page that can accept data from the user.  This is done very easily by creating a form with a bunch of input boxes ("<input type=text>").  My problem is, the page is going to be used by high-level executives, and I know it sounds bad, but they won't want to re-type all of their numbers.  The numbers that they enter will already exist in an Excel workbook that they regularly use, so I want to make is so that the users can simply select 31 cells in their Excel workbook, hit "Copy", and then go to the web page and select "Paste", and then magically, all of the data will appear in the form on the web page.

I know I have seen this done with 3rd party applications, but I'm wondering if this can be done with a simple HTML page.  I don't mind if some scripting has to be done...  maybe the user could paste into the first input box and then a script would read the entire string that was pasted and split around a tab, then fill in each box separately, I don't know.

Any thoughts or prior experience would be GREATLY appreciated.  Thanks!

-Scott
Avatar of ThinkPaper
ThinkPaper
Flag of United States of America image

you could consider using a WYSIWYG html text editor like richtext or fckeditor as a replacement to your standard "textarea" or "text" field. it should be able to accept the copies from Excel and turn them into a table, but this isn't a pretty solution as you won't be able to exactly "grab" the cell values without doing some filtering.
Avatar of scbauer
scbauer

ASKER

Okay, well I've come up with a solution, but I'm still curious if people can come up with something better.  I simply wrote some VBScript code.  The user can paste either vertical or horizontal copied cells from excel into a textarea.  When the user clicks a button, the code simply splits the text of the textarea around one of 4 or 5 possible values (Cr, Lf, Tab, etc...).  With the text broken out into an array, I then loop through the array and place the text into a bunch of input boxes.  The user can verify that the numbers are correct and then submit the form.

If anybody can come up with something that actually looks like an excel workbook that can be pasted into, I would prefer that method.  The points are still available.

-Scott
Avatar of scbauer

ASKER

By the way, ThinkPaper, thanks for the idea.  I agree that this wouldn't be "pretty" and I'm trying to present this web page to some high-level executives.  As much as I hate to say it, this must look pretty and work well.

-Scott
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial