J
Jinx
Windows IE
..NET
PROBLEM:
After invoking showModalDialog(), a form comes up, the user clicks
submit, and a NEW webpage opens.
SOLUTION
After reading numerous posts that say, paraphrased, "This can't be
done, you have to use IFRAMES", I thought I just post a solution.
Lets be careful with the "cannot be done" posts.
All you need to do is put this code in the <HEAD> of your modal page:
<SCRIPT LANGUAGE="JScript">
window.name="modal";
</SCRIPT>
and target="modal" in your modal <FORM> tag. No need for IFRAMES.
Also, when calling the showModalDialog, pass in a random number as a
querystring parameter. This will ensure that the modal won't cache
like they love to do.
var myRand = rand(50000);
var modal = window.showModalDialog('mypage.aspx?rand='+myRand, 0,
windowoptions);
RANDOM FUNCTIONS
function rnd() {
today=new Date();
jran=today.getTime();
ia=9301;
ic=49297;
im=233280;
jran = (jran*ia+ic) % im;
return jran/(im*1.0);
}
function rand(number) {
return Math.ceil(rnd()*number);
}
Hope that helps,
Jinx
http://www.JinxGear.com
..NET
PROBLEM:
After invoking showModalDialog(), a form comes up, the user clicks
submit, and a NEW webpage opens.
SOLUTION
After reading numerous posts that say, paraphrased, "This can't be
done, you have to use IFRAMES", I thought I just post a solution.
Lets be careful with the "cannot be done" posts.
All you need to do is put this code in the <HEAD> of your modal page:
<SCRIPT LANGUAGE="JScript">
window.name="modal";
</SCRIPT>
and target="modal" in your modal <FORM> tag. No need for IFRAMES.
Also, when calling the showModalDialog, pass in a random number as a
querystring parameter. This will ensure that the modal won't cache
like they love to do.
var myRand = rand(50000);
var modal = window.showModalDialog('mypage.aspx?rand='+myRand, 0,
windowoptions);
RANDOM FUNCTIONS
function rnd() {
today=new Date();
jran=today.getTime();
ia=9301;
ic=49297;
im=233280;
jran = (jran*ia+ic) % im;
return jran/(im*1.0);
}
function rand(number) {
return Math.ceil(rnd()*number);
}
Hope that helps,
Jinx
http://www.JinxGear.com