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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't enter text in popup form in IE 3

Status
Not open for further replies.

travisbrown

Technical User
Dec 31, 2001
1,016
This is confusing.


When you click "Click here to enter" You get a popup. I can type into the form with every browser except IE. There isn't actually anything that I can see that would prevent input. Any thoughts?

Don't bother entering unless you live in Calgary.
 
That popup page doesn't validate. You are using an XHTML 1.1 doctype - one of the things required for forms using XHTML is a block level element inside the form before any inputs. Ideally you would use the <fieldset> tag to do this. Your label tags are also not set up correctly (there are missing IDs for the input elements).

Also, remove ANY and ALLL whitespace from before the doctype... otherwise IE willl not actually be out of quirks mode!

Validate the HTML and validate the CSS seperately. Then see if that addresses your issue.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
>[tt]ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);[/tt]

50 means 0.05 second! If you really want that functionality, however annoying it can be, make it at least long enough to get keyboard to have a time-slot to properly response and user not keep losing field's focus all the time!
[tt]ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", [blue]5000[/blue]);[/tt]
 
Good catch tsuji!

I had forgotten completely about that being a "thousandths counter" interval, and was wondering myself why it was losing focus sooo quickly!

Keep up the good posting!
 
Jeff, thanks for the heads up on the block element and form. Didn't know that.

Unfortunately, it didn't fix the issue at hand. Page now validates, though.

tsuji...odd. I've used this popup script forever and never had this happen before. It's a window opener extension from dmxzone for Dreamweaver. Always worked so I never questioned it. I wonder what makes it different now.

Ah...I don't think I've ever used the always on top parameter for forms with this extension, so it's probably never been an issue before. Seems that is the problem. Probably time to seek out or write a new popup script. Is this an IE bug issue, or poor code? The interval 50 looks like it is there to refresh the window on top every .05 seconds. But it only impedes entry on IE.

I replaced it with generic popup code for now, so I lose positioning and always on top until I figure an alternative. Here's the original code:

Code:
<script type="text/JavaScript">
<!--
function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
		if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
		if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
		if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0; 						
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
    	ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 5000);
    	popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 5000);}; }
    if (autoCloseTime && autoCloseTime > 0) {
    	popupWindow[wp].document.body.onbeforeunload = function() {
  			if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
    		window.onbeforeunload = null;	}  
   		autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
  	window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}
//-->
</script>
Code:
onclick="GP_AdvOpenWindow('enter.asp','enter','fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no',400,400,'center','','alwaysOnTop',0,'');return document.MM_returnValue"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top