Window.Close button an object outside of a form

Results 1 to 2 of 2

Thread: Window.Close button an object outside of a form

  1. #1
    Join Date
    Dec 1969

    Default Window.Close button an object outside of a form

    I&#039;d like to use an onLoad event that gives focus to a close button (onLoad="document.closer.close.focus();")...("clos er" is the form name, "close" is the button name.)<BR><BR>Currently I have to have the close button inside of a form in order for it to be recogznied. Is there any other option...i.e. does it *need* to be inside of a form object? BTW, onLoad="document.close.focus();" doesn&#039;t work. Thanks.

  2. #2
    Join Date
    Dec 1969

    Default Can't do it...

    In order for your HTML to be legal, you *must* put all form fields inside of &#060;FORM&#062;...&#060;/FORM&#062; tags. Period.<BR><BR>MSIE will let you get away with not doing so, but even that may change in the future. IE is just being sloppy, right now.<BR><BR>But why not just create a DUMMY form that holds *just* that button???<BR><BR>&#060;FORM Name="closeForm"&#062;&#060;INPUT Type=Button Name="close"&#062;&#060;/FORM&#062;<BR><BR>And then<BR> onLoad="document.closeForm.close.focus( );"<BR><BR>You *can* have many forms on one page, so long as they are not nested. And that&#039;s legal in all browsers.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts