Copy Excel data into HTML webpage

Posted on 2014-01-20
Last Modified: 2014-01-20

I have a simple HTML form like this, laid out with 3 lines of 3 input fields:

<form name="test">
<input type="text"><input type="text"><input type="text"><br>
<input type="text"><input type="text"><input type="text"><br>
<input type="text"><input type="text"><input type="text"><br>

Open in new window

I have an Excel file, 3 rows by 3 columns, with data like this (without the dots):


If I select those 9 cells in Excel, copy them and then select an input field on my HTML form and then paste, the contents of the 9 Excel cells all go into the 1 input field.

Is there any way to have those 9 cells pasted into my 9 HTML input fields (without having to do them one by one) and if so, can someone please provide a script to do it?

Many thanks
Question by:kbit
  • 2
  • 2
LVL 33

Expert Comment

by:Big Monty
ID: 39794867
you would need to either paste the contents of the excel file into one field and then parse it out, or you would need to open the excel file server side and parse it out.

what are you ultimately trying to do? If you want to be able to edit the excel spreadsheet, have a look at this jquery plugin:

Author Comment

ID: 39794963
"you would need to either paste the contents of the excel file into one field and then parse it out,"

This sounds like a possibility, maybe submit the contents and somehow split it all out using PHP?
LVL 33

Accepted Solution

Big Monty earned 500 total points
ID: 39794980
here's a tutorial that does just that:

it requires a database to save the results in, not sure if that's part of your requirements...

Author Comment

ID: 39795120
Yes this method will work perfectly, thank you for your help

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question