cv wrote:
[color=blue]
> Grant Wagner <gwagner@agricoreunited.com> wrote in message news:<3F13145E.4AF7C2F2@agricoreunited.com>...[color=green]
> > cv wrote:
> >[color=darkred]
> > > Hi all,
> > >
> > > I have to copy two set of data from 2 files(notepad/excel) say,
> > > products and their corresponding prices to list/textarea/table. I
> > > should be able to retrieve the product and corresponding price
> > > information from the control(list/textarea/table). Which is the best
> > > way? Quite urgent.. pls let me know.
> > >
> > > TIA, cv[/color]
> >
> > Open the file in Notepad, select the text you want to copy, select Edit
> > -> Copy.
> >
> > Go into your favorite web page editor, select Edit -> Paste. Edit as
> > required.
> >
> > Alternatively you could use File -> Save as HTML in Microsoft Excel,
> > then copy and paste the table it creates into your web page editor and
> > modify it as necessary.
> >
> >
> > The point is, what you want can't be accomplished by client-side
> > JavaScript in the default security environment, and although it's
> > possible to automate it using either VBScript in Microsoft Excel, or by
> > using the Windows Script Host, you'll probably need assistance
> > completing the task.[/color]
>
> hi again,
> do you mean to say it is not possible at all to copy/paste a set of
> data like
>
> 123 $
> 456 €
> 789 @
>
> like this to a html textbox/html list/html textarea and to get the
> values in the next page after i submit the page??
> thanx for any input, cv[/color]
Client-side JavaScript is unable to perform the copy/paste, which is what I thought you wanted. If you want
to move data from one page to another, you can put whatever data you want in whatever form elements you want,
then use:
<form action="nextPage.htm" method="GET">
On nextPage.html, you'd have:
var sSearch = window.location.search.substring(1);
var Parameters = new Object();
var sNameValuePairs = sSearch.split('&');
var sNameValuePair;
for (var i = 0; i < sNameValuePairs.length; i++) {
sNameValuePair = sNameValuePairs[i].split('=');
Parameters[sNameValuePair[0]] = sNameValuePair[1];
}
// now each item passed on the URL is in
// Parameters[itemName]
// so the value of your parameter can be accessed via
// Parameters["lastName"]
Of course, all the data you pasted would be in a single input (Parameters["whatYouPasted"]). You'll have to
parse it using .split(), then you could document.write() it as an HTML table.
--
| Grant Wagner <gwagner@agricoreunited.com>
* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html
* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp
* Netscape 6/7 DOM Reference available at:
*
http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
*
http://www.mozilla.org/docs/web-deve...upgrade_2.html