472,981 Members | 1,318 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,981 software developers and data experts.

cross-frame submit works, but not reset

Hi all,

I've got two frames, one with a form ('main') and one with some clickable
images ('tp'). The clickable images call a function in 'main' (code below)
which in turn calls the .submit() or .reset() methods of the form.

The submit call does what is expected. But the reset call throws an error in
Mozilla (1.2.1) 'widget.reset is not a function'. It doesn't work in
Konqueror (3.1.1) either (don't have an error message - it just don't
work). Clicking on a reset button within the form has the expected result.

Am I doing something stoopid?

TIA,

Colin
function tp_action(targetform,action,param)
{
switch(action) {
case '':
break;
case 'submit':
widget=document.getElementById(targetform);
if (widget.onsubmit()) {
widget.submit(); // this works !!!
}
break;
case 'reset':
widget=document.getElementById(targetform);
widget.reset(); // this doesn't !!!!!
// document.forms[targetform].reset(); // nor does this !!
// document.myform.reset(); // nor does this (myform is name/id of form)

break;
default:
alert('unknown action request ' + action);
break;
}
}
<snip>
<form name='myform' id='myform' enctype='multipart/form-data' method='POST'
onsubmit='return(true);'>
Jul 23 '05 #1
2 2214
This script, in which frame is it called?

document.getElementByID will only return elements in the current frame.

Maybe you need to do something like:
parent.otherframe.document.getElementById(targetfo rm);

But then again if that is the case then its weird that it works at all

You can also call the function from another frame so,

onClick='parent.otherframe.tp_action(...)';

good luck,
Vincent

Colin McKinnon wrote:
Hi all,

I've got two frames, one with a form ('main') and one with some clickable
images ('tp'). The clickable images call a function in 'main' (code below)
which in turn calls the .submit() or .reset() methods of the form.

The submit call does what is expected. But the reset call throws an error in
Mozilla (1.2.1) 'widget.reset is not a function'. It doesn't work in
Konqueror (3.1.1) either (don't have an error message - it just don't
work). Clicking on a reset button within the form has the expected result.

Am I doing something stoopid?

TIA,

Colin
function tp_action(targetform,action,param)
{
switch(action) {
case '':
break;
case 'submit':
widget=document.getElementById(targetform);
if (widget.onsubmit()) {
widget.submit(); // this works !!!
}
break;
case 'reset':
widget=document.getElementById(targetform);
widget.reset(); // this doesn't !!!!!
// document.forms[targetform].reset(); // nor does this !!
// document.myform.reset(); // nor does this (myform is name/id of form)

break;
default:
alert('unknown action request ' + action);
break;
}
}
<snip>
<form name='myform' id='myform' enctype='multipart/form-data' method='POST'
onsubmit='return(true);'>


Jul 23 '05 #2
Colin McKinnon wrote:
<snip>
... 'widget.reset is not a function'. ...

<snip>

<URL: http://www.jibbering.com/faq/faq_not....html#faComMis >

Richard.
Jul 23 '05 #3

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

Similar topics

0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
3
by: rollasoc | last post by:
Hi, Doing a bit of system testing on a Windows 98 laptop. (.Net 1.1 app). Did a bit of testing. Loaded a previously saved file. A gray box appeared with the text and buttons all white...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
4
by: David Peach | last post by:
Hello, hope somebody here can help me... I have a query that lists defects recorded in a user defined date range. That query is then used as the source for a Cross Tab query that cross-tabs count...
23
by: Jeff Rodriguez | last post by:
Here's what I want do: Have a main daemon which starts up several threads in a Boss-Queue structure. From those threads, I want them all to sit and watch a queue. Once an entry goes into the...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
1
by: Rob Woodworth | last post by:
Hi, I'm having serious problems getting my report to work. I need to generate a timesheet report which will contain info for one employee between certain dates (one week's worth of dates). I...
6
by: Simon | last post by:
Hi All, An experiment i'm doing requires requires a synchronous cross-domain request, without using a proxy. I wondered if anyone had any ideas to help me achieve this. Below is what I have...
6
by: Bart Van der Donck | last post by:
Hello, I'm presenting my new library 'AJAX Cross Domain' - a javascript extension that allows to perform cross-domain AJAX requests. http://www.ajax-cross-domain.com/ Any comments or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.