S
Shaun Fleming
I've been trying to make this simple script compatible across various
browsers. It works for IE 6.0 and NS 7 but doesnt work with Opera (I
have version 7.11). This is what is supposed to happen: when the user
clicks a button in the main window, a dialog window pops up. In the
dialog the user enters a university to search for. When the string is
submitted, the dialog then shows all the matches found in the
database. The user picks one and clicks the Submit button. The Submit
button's code is as follows:
<INPUT type="button" value="Submit"
onclick="javascript:refreshParentWizard(window,
parent.opener.location);">
It calls refreshParentWizard(), whose sole purpose is to edit the
query string arguments so that the main page will save itself when a
university is returned. Its code is:
function refreshParentWizard(window, location) {
// find the querystring (if it exists)
iQueryString = location.href.indexOf('?');
if (iQueryString > -1) {
location.href=location.href.substring(0, iQueryString) +
"?action=quicksave&screen=previous_education&";
}
else {
location.href=location +
"action=quicksave&screen=previous_education&";
}
document.forms[0].submit();
self.close();
return true;
}
After the button is clicked, the function is called which submits the
form and closes the window (as seen in the code above). Then the main
window is refreshed displaying the University the user picked in a
field. The problem is Opera will refresh the main page but the
selected university does not show up. I have tried many different ways
to do it but none will work. I have checked to make sure that the form
is passing the right query string arguments when submitted and it is
passing the same arguments in every browser. I have also checked the
docs for Opera to see if it supports the functions and it appears that
it does. I was having problems getting the script to work in NS but I
got it to work by changing the Submit button type from "submit" to
"button" and simply calling form.submit(). I am pretty lost so if
anyone could help me, it would be greatly appreciated.
Thanks,
Shaun
browsers. It works for IE 6.0 and NS 7 but doesnt work with Opera (I
have version 7.11). This is what is supposed to happen: when the user
clicks a button in the main window, a dialog window pops up. In the
dialog the user enters a university to search for. When the string is
submitted, the dialog then shows all the matches found in the
database. The user picks one and clicks the Submit button. The Submit
button's code is as follows:
<INPUT type="button" value="Submit"
onclick="javascript:refreshParentWizard(window,
parent.opener.location);">
It calls refreshParentWizard(), whose sole purpose is to edit the
query string arguments so that the main page will save itself when a
university is returned. Its code is:
function refreshParentWizard(window, location) {
// find the querystring (if it exists)
iQueryString = location.href.indexOf('?');
if (iQueryString > -1) {
location.href=location.href.substring(0, iQueryString) +
"?action=quicksave&screen=previous_education&";
}
else {
location.href=location +
"action=quicksave&screen=previous_education&";
}
document.forms[0].submit();
self.close();
return true;
}
After the button is clicked, the function is called which submits the
form and closes the window (as seen in the code above). Then the main
window is refreshed displaying the University the user picked in a
field. The problem is Opera will refresh the main page but the
selected university does not show up. I have tried many different ways
to do it but none will work. I have checked to make sure that the form
is passing the right query string arguments when submitted and it is
passing the same arguments in every browser. I have also checked the
docs for Opera to see if it supports the functions and it appears that
it does. I was having problems getting the script to work in NS but I
got it to work by changing the Submit button type from "submit" to
"button" and simply calling form.submit(). I am pretty lost so if
anyone could help me, it would be greatly appreciated.
Thanks,
Shaun