[thelist] Reserting fields in submited Form doesn't work in opera :((( ?
Maryanna Nesina
mar at MN1052.srv.pu.ru
Tue Dec 4 18:51:56 CST 2001
I was writing some pages with form submission and checking the fields. The
target of this form is another window but I don't want the info to be left
in input fields after the submiting is OK (in some pages I do deal with
usernams of those, who connect to my CGI HTTP-SMTP/POP3 server ). So I
decided to do the following : when the new window is closed, the focus in an
old one is left on Submit button. So I check if the form was submited (by
the global variable) and if so, Reset the form. All is OK in IE (I tested
only in IE5 yet), NN 3.1; NN4; NN6, Mozilla But nothing is "reseted" in
Opera5,2
Does somebody know why it is so?
Should be thankful for any suggestion,
Here is the piece of code that submit and reset :)) my form:
<script language="JavaScript">
var submiting = 0; /* Glabal Variable - Flag to know if the form was
submited */
function popup() {
window.open("", "popup", "resizable=no, menubar=no, status=no, toolbar=no,
location=no, width=200, height=200, innerHeight=200, innerWidth=200");
return true;
}
function
ckForm(f){
submiting = 0;
............................ code to check for all the necessory fields to be filled in proparlly .........................................
if (err==0) { /*If ewerything is OK then we call the function that open popup window in which CGI answer would be delivered*/
popup();
submiting=1; /*Flag on*/
return true; /*return true for to submit the form */
}
....................Then comes code to show error messages and focus in the Form's field that should be corrected ..........................................
return false;
}
</script>
then comes the Form itself
<form name="somename" method="post" action="myCGI.cgi" target="popup" onSubmit="return CheckForm(this);">
the fields
the fields
the fields
<input type="submit" name="Submit" value="Submit" onFocus="if(submiting==1){ emalform.reset();}">
<input type="reset" name="Reset" value="Reset">
</form>
Best regards,
Maryanna Nesina
mar at ma
il.bio.pu.ru
http://www.bio.pu.ru/~mar
More information about the thelist
mailing list