shramana
12-20-2005, 11:01 AM
I am encountering a problem where I have a window and there are three
frames, one in the left, right and in the bottom. The bottom most frame has
common submit buttons. There are several tabs in left frame. Each one loads
a different form on the right frame. After fetching the contents of the form
from user, I am validating the text fields in the form using onChange() event
handler. After entering the text value in the textbox, if I press Submit
directly, the "Submit" as well as the validation routine happens concurrently.
Only at the end of validation, the field is marked as dirty. Now, if field is not
marked dirty, the Submit function will close the window without actually
submitting as nothing was changed. So when an invalid value is entered and
the Submit is pressed directly, an alert pops up temporarily but the close()
call from the parent frame immediately closes the alert window before user
can respond. This problem does not occur in IE as in IE, unless the alert
window is responded, the close() call cannot close the alert window. For eg:
For eg:
My left frame contains something like this:
var isDirty=0;
function doSubmit(){
if (!isDirty)
top.close;
}
document.Taskform.submit();
return;
}
In the right frame I have function handleInput() which is called using onChange event handler.
function markDirty(){
top.frameHead.isDirty=1;
}
function handleInput(){
storeInput["InputA"] = document.TaskForm["inputA"];
if(isInteger(input) == false)
{
window.alert("Number is not an integer !!!");
return false;
}
return true;
markDirty();
}
Now if I enter an invalid value in the text element and press submit directly instead of accessing any other form element, then doSubmit() as well as handleInput()get trigerred and run concurrently. The onChange event triggers
the alert for the invalid value, but since dirty field is not yet set at that instant, the top.close closes the alert. So the alert just pops up and immediately gets closed. This behavior is in Firefox as well as Mozilla but not in IE. In IE, the alert function is modal across ALL windows i.e., ALL processing ceases until the user clicks the OK button in the alert window.
Firefox/Mozilla however is NOT modal across all windows BUT only within the
current window.
ie.
With Firefox / Mozilla:
If a window is opened, and some javascript within the HTML file being
loaded into that new window, calls alert(), this will popup an alert
box. However, if the parent of the new window, attempts to close it's
child window, then the alert is automatically dismissed, and the
window closed.
Can you experts please let me know how I can approach this problem ?
Thanks.
frames, one in the left, right and in the bottom. The bottom most frame has
common submit buttons. There are several tabs in left frame. Each one loads
a different form on the right frame. After fetching the contents of the form
from user, I am validating the text fields in the form using onChange() event
handler. After entering the text value in the textbox, if I press Submit
directly, the "Submit" as well as the validation routine happens concurrently.
Only at the end of validation, the field is marked as dirty. Now, if field is not
marked dirty, the Submit function will close the window without actually
submitting as nothing was changed. So when an invalid value is entered and
the Submit is pressed directly, an alert pops up temporarily but the close()
call from the parent frame immediately closes the alert window before user
can respond. This problem does not occur in IE as in IE, unless the alert
window is responded, the close() call cannot close the alert window. For eg:
For eg:
My left frame contains something like this:
var isDirty=0;
function doSubmit(){
if (!isDirty)
top.close;
}
document.Taskform.submit();
return;
}
In the right frame I have function handleInput() which is called using onChange event handler.
function markDirty(){
top.frameHead.isDirty=1;
}
function handleInput(){
storeInput["InputA"] = document.TaskForm["inputA"];
if(isInteger(input) == false)
{
window.alert("Number is not an integer !!!");
return false;
}
return true;
markDirty();
}
Now if I enter an invalid value in the text element and press submit directly instead of accessing any other form element, then doSubmit() as well as handleInput()get trigerred and run concurrently. The onChange event triggers
the alert for the invalid value, but since dirty field is not yet set at that instant, the top.close closes the alert. So the alert just pops up and immediately gets closed. This behavior is in Firefox as well as Mozilla but not in IE. In IE, the alert function is modal across ALL windows i.e., ALL processing ceases until the user clicks the OK button in the alert window.
Firefox/Mozilla however is NOT modal across all windows BUT only within the
current window.
ie.
With Firefox / Mozilla:
If a window is opened, and some javascript within the HTML file being
loaded into that new window, calls alert(), this will popup an alert
box. However, if the parent of the new window, attempts to close it's
child window, then the alert is automatically dismissed, and the
window closed.
Can you experts please let me know how I can approach this problem ?
Thanks.