473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem with Opera and JavaScript

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
Jul 20 '05 #1
6 2692


Shaun Fleming wrote:
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.


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/

Jul 20 '05 #2

Upgrade to IE ... lol ;) ... jk
On 21 Jan 2004 08:55:30 -0800, sp***@mail.umd.edu (Shaun Fleming)
wrote:
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


Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
Jul 20 '05 #3
sp***@mail.umd.edu (Shaun Fleming) wrote in message news:<e9**************************@posting.google. com>...

if (iQueryString > -1) {
location.href=location.href.substring(0, iQueryString) +
"?action=quicksave&screen=previous_education&" ;
}
else {
location.href=location +
"action=quicksave&screen=previous_education&";
}


don't you want "?action=..." here?
Jul 20 '05 #4
ri******@cs.northwestern.edu (Chris Riesbeck) wrote in message news:<b7**************************@posting.google. com>...
sp***@mail.umd.edu (Shaun Fleming) wrote in message news:<e9**************************@posting.google. com>...

if (iQueryString > -1) {
location.href=location.href.substring(0, iQueryString) +
"?action=quicksave&screen=previous_education&" ;
}
else {
location.href=location +
"action=quicksave&screen=previous_education&";
}


don't you want "?action=..." here?


Yea it is "?action=..." in the actual code. I mustve somehow deleted
the question mark when pasting the code. Sorry.

Shaun
Jul 20 '05 #5
Martin Honnen <ma*******@yahoo.de> wrote in message news:<40********@olaf.komtel.net>...
Shaun Fleming wrote:
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.


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.


Sorry for the delay in response. I had to ask my boss if it was ok to
post the site. And No I am not getting any errors in the Javascript
console. I am currently looking at another thread where another guy
had a similar problem as me with Opera 7 (I think the thread is called
"Javascript and Opera 7" or something along those lines). The link to
the site is <a href="https://was-1.umd.edu/admissions/Entry.jsp">https://was-1.umd.edu/admissions/Entry.jsp</a>
but u will need to fill out some registration stuff bc this web app is
currently being used for graduate applications. Once you've filled out
everything and returned the confirmation email, the problem is when
you click the Previous Education tab and click the magnifying glass
next to the "College/University" text field. Another window will then
pop up where you will have to enter a search string for a college
name. Once you submit the search a list of matches will come up.
Select one and click submit. The dialog window will close and the main
page will be refreshed but instead of having the text field next to
the magnifying glass, you should see a bullet and the college you
picked. However, this doesnt work in Opera (the form does not seem to
be submitted for some reason). If you want to see how it should work,
do the steps above in IE or Netscape 7. And again, any suggestions
would be greatly appreciated.

Thanks,
Shaun

P.S. You might not want to actually submit the entire application
because this site is a prod site and all applications do get looked at
by the University.
Jul 20 '05 #6
Hi,
I solved my problem yesterday. After looking at many threads in this
newsgroup, I was getting the impression that many other people were
having a problem submitting a form in Opera via the form.sumbit()
function. I experimented with the code and realized that Opera does
not submit the form when the form.submit() function is called.
However, there is no error in the JavaScript console. I tried changing
the input type of the Submit button from "button" to "submit" (I was
using an ordinary button that, when clicked, called a function to
submit the form, refresh the main page, and close the current child
window in which the form was located. I did this because I was having
some problems using an input of type "submit" in Netscape.) Upon
changing the type of the button to "submit", the form was properly
submitted but I could not close the child window which it was in
because it would either close the window before the form was submitted
or it would submit the form and load a white screen before the close()
function could be called. The solution to this (at least the only one
I could think of that would work in my particular situation) is to put
"onunload="javascript:window.close()" in the body tag. Even though it
seems redundant, in that one would figure that this would be called
when the window was being closed and as a result be in the process of
unloading, it works because this is called after the form has been
submitted but before the next page (the white screen resulting from
the submission) was loaded. After testing it with under various
circumstances (i.e. Opera's spoofing ability and other variations),
the modification seems to work in all cases. Thanks to all who took
the time to read and try to help me out.

Shaun Fleming
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
3
by: Marcus Bjorke | last post by:
I use a print link that causes a problem with Opera 7. The link looks like this <a href="javascript:parent.frames.mainFrame.print()">Print this page</a> I also used <a...
5
by: Paul Fi | last post by:
Can someone help me here because this is really killing me! the problem is, i have this javascript code in my aspx page that i want it to work on almost all browsers, especially opera and safari...
4
by: VR | last post by:
First, greetings to everyone :) I'm doing a university seminar & I've encountered a problem. I have a gallery with thumbnails linked on pictures. What I want is popup to be opened with...
1
by: Paul Fi | last post by:
can some one help me here coz this is really killing me! the problem is, i have this javascript code in my aspx page that i want it to work on almost all browsers, especially opera and safari : ...
34
by: Simon Wigzell | last post by:
document...focus() will scroll the form to move the specified text field into view on everything I have tried it with except Safari on the MAC. The form doesn't move. Any work around? Thanks.
1
by: Alexandre Lahure | last post by:
Hi all, The facts : a rich text editing applet, a HTML/Javascript toolbar and Liveconnect to make them communicate alltogether. - Java to JS communication (for updating the state of the toolbar...
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
15
by: dhtml | last post by:
Title says it. If I use a for in loop on an HTML collection, I get length twice. <!DOCTYPE HTML> <html lang="en"> <head> <title>length twice</title> </head> <body> <form...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.