This article may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. To maintain the flow of the article, we've left these URLs in the text, but disabled the links.


MIND


GEEK

Robert Hess

GEEK I have an ASP page that gathers data about what variables to display on a report listing. It is a form that posts to a frameset ASP, and I want the variables to be passed to just one frame (so the report will scroll separately in the middle of the page), which is another ASP page that actually reads the database and produces a listing based on the variables submitted from the previous page. I tried to add a

 TARGET=framename 
on the POST statement, but that didn't work. Can this be done?
GEEK Creating a multiframe page, with a <form> in one frame and the form action targeted at another frame, should work perfectly fine. Figure 1 contains some sample files I quickly whipped up that show this.

GEEK Is there a way to initiate a Ctrl+F (find on this page) keystroke with a button on a Web page?
GEEK The quick answer is no.
      Some of the menu capabilities exposed by Microsoft®Internet Explorer are accessible in script. They are accessed via the ExecWB method that is exposed by the Web browser itself. Using this, it is possible to cause the Open, Print, Save As, and a few other features to be executed (see Figure 2). However, the Find menu option is not part of the standard set of OLE Command IDs (which is what is being executed here) that can be used by ExecWB.
      Of course, there is another option. And that would be to do the find and select operations yourself, all within the confines of the Web page.
      Starting with Internet Explorer 4.0, there is a new type of Dynamic HTML object called TextRange on which you can perform various sorts of operations, including both finding and selecting text. Figure 3 shows a very simple example of how you can use this to present a Find form on your page, which will in turn locate the first occurence of the specified text on your page and highlight it.
      Or, if you still really, really want to use the browser's "Find" dialog, I suppose you could write an ActiveX®control, which would do a SendKeys of a Ctrl+F to the browser, but I wouldn't recommend going that far.

GEEK I wrote the following JScript® functions in order to try some of the new features of both Internet Explorer and Netscape Navigator, but I've had a problem with the code. These two functions change the color and the fontWeight attributes of some hypertext links:



 function DoOnMouseOver() 
 {
      if ((is_nav4up == true) | (is_ie4up == true)) 
     {
           window.event.srcElement.style.color = "#0000CC";
           window.event.srcElement.style.fontWeight= 700;
     }
 }
 
 
 function DoOnMouseOut() 
 {
     if ((is_nav4up == true) | (is_ie4up == true)) 
     {
          window.event.srcElement.style.color = "#000000";
          window.event.srcElement.style.fontWeight = 400;
     }
 }
Everything seems to work fine when I use Internet Explorer 4.01, but with Netscape Communicator, a "window.event has no properties" error is returned. What can I do to make this script Netscape-compatible?
GEEK Netscape Navigator's implementation of Dynamic HTML, and specifically how it implements events and access to Cascading Style Sheet (CSS) properties of individual page elements, is a lot different from Internet Explorer.
      It sounds like you're trying to produce a rollover effect where the color and boldness of some text is modified whenever the mouse rolls over it. This is commonly used on Web pages for highlighting links. There are many different ways to do this on your pages, but Figure 4 shows a method that is most similar to your solution:
      This sample takes into account that event bubbling is something only Internet Explorer provides. By setting the document's onmouseover and onmouseout events in this fashion, they will only be captured if you're running Internet Explorer 4.0 or above, not Navigator 4.x.
      Now test the class name of the item that fired the event to determine if it is an item you want to whack.
      If you really want to perform this sort of rollover effect on Netscape Navigator, it is possible to do, but not nearly as easy or elegant. It is also more then I can cover here. Fortunately, I was able to find the following example on the Web:
>http://www.webreference.com/js/column4/workarounddemo.html

From the October 1999 issue of Microsoft Internet Developer.