C
Colin McKinnon
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);'>
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);'>