Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have an application with an index.html page that loads two frames.

Status
Not open for further replies.

Frazzled

MIS
Oct 10, 1998
2
0
0
US
I have an application with an index.html page that loads two frames.<br>
One is a navigation bar (using JavaScript) with options that change<br>
color when you mouseover/mouseout. On that frame is a form (menuForm) with hidden fields that save results of user's initial input and its validation (or not), after they have entered their account info on the other frame and submitted it. When user has validated successfully, they can click on an option on the navigation bar and then I post the form with the hidden data and send it to a servlet. The servlet returns (in the other frame - "body" ) the results of whatever option user selected. The code bits below work on Netscape, but IE 4.0 gives me a script error because it doesn't like the "document.captureEvents(Event.CLICK);" line. This code is the only way I know to just load the results sent back from the servlet without then immediately replacing them by overwriting with the link in the &lt;A HREF=... (The clickHandler(Click) code with the eventual return of false stops the link event from occurring.) Since IE doesn't work with this, does anyone know another way to stop the link from occurring, or is there another way I can do a submit without a button in my code that will simply do the submit and put the results in my "body" frame?<br>
<br>
I'm sorry for the length of this question, but I don't know much about any scripting language and I'm at my wits end as to how to get this to work on both browsers. Any help will be very gratefully received!<br>
<br>
Here's the HTML on the navigation bar...<br>
<br>
&lt;A HREF="companyMain.htm" onMouseOver="apage1()" onMouseOut="bpage1()"&gt; <br>
&lt;IMG SRC="company.gif" WIDTH=144 HEIGHT=12 BORDER=no&gt;&lt;/A&gt;<br>
<br>
Here's the JavaScript...<br>
<br>
document.captureEvents(Event.CLICK);<br>
document.onClick = clickHandler;<br>
<br>
function clickHandler(Click)<br>
{<br>
// **************************************************************<br>
// ** Setup for view results..<br>
// **************************************************************<br>
<br>
document.menuForm.submit();<br>
document.menuForm.target="body";<br>
return false;<br>
}<br>

 
I figured out what it wanted. Instead of just trying to return a "false" from the function I called, I needed to change the &lt;A HREF to say "return clickHandle...", and then add that clickHandle to each &lt;A HREF where I wanted that to occur. It seems simple after you get it, but I sure wish I'd had a book with examples when I was trying to figure it out!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top