Shaun Fleming wrote:
[color=blue]
> 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.[/color]
Are you getting any errors in the Opera JavaScript console?
Although you have provided a long description anyone trying to
understand what could go wrong will much easier be able to do that if
you provide a URL to a test page where the problem happens. I understand
that it might be a problem if server side code is involved that is not
on a public server but maybe a test case with static pages allows to
demonstrate the problem.
--
Martin Honnen
http://JavaScript.FAQTs.com/