473,547 Members | 2,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy and Paste form in another frame

Hi all,

I am trying to copy a form that is in one frame, using a button on another
frame. The form has a couple of tables inside it. I can get it working
when the button is in the same frame, but not in different ones. I get an
"invalid argument" error on the controlRange.ad dElement(x) line.

What I have so far is:

<script language='javas cript'>
function CopyForm() {
if (document.body. createControlRa nge) {
var x = window.parent.f raRight.documen t.getElementByI d('Form1');
x.contentEditab le = 'true';
var controlRange;
controlRange = document.body.c reateControlRan ge();
controlRange.ad dElement(x);
controlRange.ex ecCommand("Copy ");
x.contentEditab le = 'false';
alert('The table is now copied to memory. \nStart Excel, and Paste
the table into a new worksheet.');
}
</Script>

where fraRight is the name of the frame the form is in, and Form1 is the
name of the form I want to copy. The only thing I have changed from when it
was working in the one frame, is:
var x = window.parent.f raRight.documen t.getElementByI d('Form1');
used to be
var x = document.getEle mentById('Form1 ');

I can do things like alert(x.name) and get the right name of the form, so I
think I have got the object properly. Is there any other way to tell?

Any help appreciated.

Thanks,

Bob T
Jul 17 '05 #1
2 4999
Bob T Bunny wrote:
:: Hi all,
::
:: I am trying to copy a form that is in one frame, using a button on
another
:: frame. The form has a couple of tables inside it. I can get it working
:: when the button is in the same frame, but not in different ones. I get
an
:: "invalid argument" error on the controlRange.ad dElement(x) line.
::
:: What I have so far is:
::
:: <script language='javas cript'>
:: function CopyForm() {
:: if (document.body. createControlRa nge) {
:: var x = window.parent.f raRight.documen t.getElementByI d('Form1');
:: x.contentEditab le = 'true';
:: var controlRange;
:: controlRange = document.body.c reateControlRan ge();
:: controlRange.ad dElement(x);
:: controlRange.ex ecCommand("Copy ");
:: x.contentEditab le = 'false';
:: alert('The table is now copied to memory. \nStart Excel, and
Paste
:: the table into a new worksheet.');
:: }
:: </Script>
::
:: where fraRight is the name of the frame the form is in, and Form1 is the
:: name of the form I want to copy. The only thing I have changed from when
it
:: was working in the one frame, is:
:: var x = window.parent.f raRight.documen t.getElementByI d('Form1');
:: used to be
:: var x = document.getEle mentById('Form1 ');
::
:: I can do things like alert(x.name) and get the right name of the form, so
I
:: think I have got the object properly. Is there any other way to tell?
::
:: Any help appreciated.
::
:: Thanks,
::
:: Bob T

--
This is a Java newsgroup not to be confused with javascript. Try posting
to:

comp.lang.java. javascript
comp.lang.javax cript

Thanks in Advance...
IchBin
_______________ _______________ _______________ _______________ ______________

'Laughter is inner jogging'
- Norman Cousins, editor and author (1915-1990)
Jul 17 '05 #2
Oops. Thanks for that.

Bob T

"IchBin" <we***********@ pdt.net> wrote in message
news:_o******** ************@pt d.net...
Bob T Bunny wrote:
:: Hi all,
::
:: I am trying to copy a form that is in one frame, using a button on
another
:: frame. The form has a couple of tables inside it. I can get it working :: when the button is in the same frame, but not in different ones. I get
an
:: "invalid argument" error on the controlRange.ad dElement(x) line.
::
:: What I have so far is:
::
:: <script language='javas cript'>
:: function CopyForm() {
:: if (document.body. createControlRa nge) { ....
.... ::
:: Thanks,
::
:: Bob T

--
This is a Java newsgroup not to be confused with javascript. Try posting
to:

comp.lang.java. javascript
comp.lang.javax cript

Thanks in Advance...
IchBin
_______________ _______________ _______________ _______________ ______________

'Laughter is inner jogging'
- Norman Cousins, editor and author (1915-1990)

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9535
by: cv | last post by:
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
2
2647
by: tedqn | last post by:
This may sound weird but I'm try to find a way to copy the whole docoument from one frame to another. It's sort of like stowing away the whole page to another frame so that user can use the main frame for other things. When done, the user then can pull back the previous page into the main frame. I tried the swapping with...
1
2210
by: Bob T Bunny | last post by:
Hi all, I am trying to copy a form that is in one frame, using a button on another frame. The form has a couple of tables inside it. I can get it working when the button is in the same frame, but not in different ones. I get an "invalid argument" error on the controlRange.addElement(x) line. What I have so far is: <script...
2
2903
by: Greg | last post by:
Hi all, Is there a way to copy multiple objects into the clipboard and then paste them? What I want to achive is to be able to copy UI controls (textedits, dropdowns, etc) from one form and paste them into another form. Your help is much appriciated. Thanks in advance, Greg.
6
2606
by: NuB | last post by:
I have a winform and a menu on the form, It allows the users to copy and paste text from text boxes. I never had to do this before, how can I copy and paste text from one box to another?
7
11608
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an...
9
4208
by: =?Utf-8?B?VGVycnk=?= | last post by:
Hi, Is it possible (w/o generating a gazillion errors) to copy a form in VS 2005 so that it can be modified and reused. In other words, I have a form, alot of which I wish to use in a different form. An no, I don't want to inherit it. I just want to steal the layout and add and remove a few other pieces. Any easy way to do this? --...
5
9247
by: mbatestblrock | last post by:
I was wondering if it were possible to do this. I have a form that is used to input a ton of information and then I have a button on it it to export it into a word template to print out. Now I have another form that I want to start populating after the word export is done. So I was trying to think of a way to get the SOME of the same...
5
11102
by: phill86 | last post by:
Hi I have a main form that holds records for scheduled meetings, date time location etc... in that form i have a sub form that has a list of equipment resources that you can assign to the meeting in the main form. I have two buttons in the sub form one for selecting and copying all the records and another for pasting the records this enables me to...
0
7510
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7437
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7797
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3473
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
748
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.