HTML - Window Focus (safari Vs. The Rest)
Ok, I have a button in the main site and when it is clicked a pop up window opens and the user can navigate and do whatever. Then they can go back to the main site and click another button which is supposed to then give focus to the pop up window again (just a different part).
Here's the thing: It works just fine in Safari. Whenever a button is clicked the focus goes back to the popup window, yet every other browser seems to keep the popup window behind. Any idea of how to FORCE the popup window to have focus? Thanks. Similar TutorialsCan anyone tell me what i did wrong? I havent coded in a while but i think i didd it right. Its for my friends uncle. Can anyone tell me why this works fine in ff (my browser) not IE, or safari? The page should be centered and be connected at the top. No other spaces. krrose27.com/flip/ Hi everyone Let me first say how awesome it is for the web to have a place like this where other html coders can relate. I've been lurking here for a couple months and now I come in with a bang, ha, yes a question. Nonetheless...I'm very greatful to be here. So onto my question.. I'm an assistant on a web design project and I'm having trouble aligning text on a website. I used divs on a WYSIWYG editor to place the text and when I opened the page everything looked fine, of course that was because it was done on this computers resolution specs. Now if you look you will see that when you are either: A) On a different resolution on another computer the text look ambiguous and doesn't align propery B) Minimizing the window or changing its shape the text also doesn't align. So my question is, how do I resolve this matter. Any html pro's or programmers in whatever arena would be truly appreciated in taking a look at this issue for me. Oh and about styles..I don't know much about css as I'm still a beginner and I'm thinking I can't even use styles since I already have that <style> code in there already, but it's not a css one. So I've written that off. Here is the website so you can see the issue (assuming you're not on 1280 for your width in resolution and not in full screen). URL - http://blendsphere.com/mailconnect/ Once at the site you can pull up the html code to see it too. Again thanks for any support or solutions on this. I am relatively new to the web design world so if you do have any solutions if you could make it brief that would be fantatstic. Ok thanks again. Please enlighten this noob, so far I've been enjoying html and hope to do so for much longer. I've kept up with things and it's no surprise that after all these years HTML is still so damned popular. Alright then. hi, as shown in the pic, the line and the word "Hello" has a gap in between, how can i remove the gap or space to allow the line to sit directly on top of the word Hello ?? Hi! I'm a Opera diehard since I know it's the only browser that does all measures (height/width/etc) 100% correct. And usually when something doesn't show up right in another browser I have different kinds of 'backups' ready, but this time I'm pretty lost. This is the thing I'm busy with: test.html (As you might notice it's pretty much based on the old YouTube menu.) It really only shows up fine in Opera but just to show you guys what it looks like in the other browsers: All Browsers - Picture The codes (test.html): Quote: <html> <head> <title>TEST</title> </head> <body style='background:white'> <center> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td width="177" height="28"></td> <td width="130" height="28" align="center" valign="middle" background="active.png"> <font color="#333333" size="2" face="sans-serif"><b>Link 1</b></font></td> <td width="130" height="28" align="center" valign="middle" background="inactive.png"> <a href="link2.html" style="text-decoration: none;"> <font color="#003399" size="2" face="sans-serif"><b>Link 2</b></font> </a></td> <td width="130" height="28" align="center" valign="middle" background="inactive.png"> <a href="link3.html" style="text-decoration: none;"> <font color="#003399" size="2" face="sans-serif"><b>Link 3</b></font> </a></td> <td width="130" height="28" align="center" valign="middle" background="inactive.png"> <a href="link4.html" style="text-decoration: none;"> <font color="#003399" size="2" face="sans-serif"><b>Link 4</b></font> </a></td> <td width="177" height="28"></td> </tr> <tr> <td background="bar.png" colspan="6" width="874" height="37" align="center" valign="middle"> <form id="form" method="post" action="formcorrect.php" enctype="multipart/form-data"> <font color="#333333" size="2" face="sans-serif">URL:</font> <input type="text" name="url" size="40" value=""> <input type="submit" name="submit" value="Send"> <input type="hidden" name="config" value="0""></form> </td> </tr> </table> </center> </body> </html> (Also available over here.) The form isn't active, nor are the pages linked to Link 2-4. The meaning obviously is that the input is centered (align and valign) in all browsers. The pictures used: 1x active.png: 130 x28px (white on the sides included) 3x inactive.png: 130 x28px 1x bar.png: 874 x37px (colspan=6) 2x 177 x28px (= free space on both sides of top row) Calculation: 177 + 130 + 130 + 130 + 130 + 177 = 874 Well, I think that's all I can say. Hope someone could help me out! Thanks a lot in advance! can i have fixed layout for only some part of a table? I want the first column of my table to be "auto" and the other columns to be "fixed" llike style='table-layout:fixed;'. How can I achieve this? Thanks! Hi. I am creating web service. But the problem must be somewhere on HTML page. When I submit form, the data send by web service (java program) to the page does not show up. If I do not submit form, then the program works; results appear on the page. The form is submitted invoking pushSubmit() javascript function. This method is invoked from setMessage() javascript function. I submit form cause in this way I discover what value is selected on drop down list. This is done using JSP code. Can I do it somehow else. Next action using retrieved data is to invoke Java class on server side. What might be the problem? This is the code: Code: <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" pageEncoding="UTF-8" %> <%@ page import="mart.ebay.database.ReadsCategoryTable" %> <jsp:useBean id="categoryList" class="mart.ebay.database.ReadsCategoryTable" scope="request" /> <jsp:setProperty name="categoryList" property="*"/> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>eMart</title> </head> <body class="create"> <!-- shows items from that country by default --> <% // String strSiteId = "EBAY-GB"; // Object categoryList = session.getAttribute("items"); // receives result from servlet // out.println(categoryList + " result ++++++++++++++++++++++++++++"); // strSiteId = (String)session.getAttribute("siteId"); // strSiteId =(strSiteId == null)? "": strSiteId; // out.println(strSiteId+ " strSiteId +++++++++++++++"); %> <% String result= ""; String strSiteId = request.getParameter("siteId"); strSiteId =(strSiteId == null)? "": strSiteId; if(strSiteId.equals("")) { out.println(strSiteId+ " global ID is empty"); result= categoryList.readTable("EBAY-GB"); } else { out.println(strSiteId+ " this is global ID"); result= categoryList.readTable(strSiteId); } %> <div id="container"> <div id="header"> <h1>Header</h1> <!-- end of header--> </div> <div id="mainContent"> <h1>Main content</h1> <!-- onsubmit="run()" --> <form name="form" id="form1" action="index.jsp" method="post" > <table id="input" border="0" cellpadding="0" cellspacing="5"> <tr> <th align="left">Looking for</th> <th align="left">Location</th> <th align="left">Category</th> </tr> <tr> <td align="left"><label><input style="width: 230px" type="text" name="message" id="message" /></label> </td> <td> <select name="siteId" id="siteId" > <option <%=(strSiteId.equals("EBAY-AT"))?"selected":""%> value="EBAY-AT">Austria</option> <option <%=(strSiteId.equals("EBAY-AU"))?"selected":""%> value="EBAY-AU">Australia</option> <option <%=(strSiteId.equals("EBAY-CH"))?"selected":""%> value="EBAY-CH">Switzerland</option> <option <%=(strSiteId.equals("EBAY-DE"))?"selected":""%> value="EBAY-DE" >Germany</option> <option <%=(strSiteId.equals("EBAY-ES"))?"selected":""%> value="EBAY-ES">Spain</option> <option <%=(strSiteId.equals("EBAY-FR"))?"selected":""%> value="EBAY-FR">France</option> <option <%=(strSiteId.equals("EBAY-FRBE"))?"selected":""%> value="EBAY-FRBE">Belgium (French)</option> <option <%=(strSiteId.equals("EBAY-NLBE"))?"selected":""%> value="EBAY-NLBE">Belgium (Dutch)</option> <option <%=(strSiteId.equals("EBAY-FRCA"))?"selected":""%> value="EBAY-FRCA">Canada (French)</option> <option <%=(strSiteId.equals("EBAY-ENCA"))?"selected":""%> value="EBAY-ENCA" onclick="pushSubmit()" >Canada (English)</option> <option <%=(strSiteId.equals("EBAY-GB"))?"selected":""%> value="EBAY-GB" selected="true">United Kingdom</option> <!-- <option value="EBAY-HK">Hong Kong</option> --> <option <%=(strSiteId.equals("EBAY-IE"))?"selected":""%> value="EBAY-IE" onclick="pushSubmit()" >Ireland</option> <option <%=(strSiteId.equals("EBAY-IN"))?"selected":""%> value="EBAY-IN">India</option> <option <%=(strSiteId.equals("EBAY-IT"))?"selected":""%> value="EBAY-IT">Italy</option> <!-- <option value="EBAY-MOTOR">Motors</option> --> <option <%=(strSiteId.equals("EBAY-NL"))?"selected":""%> value="EBAY-NL">Netherlands</option> <option <%=(strSiteId.equals("EBAY-NLBE"))?"selected":""%> value="EBAY-NLBE">Belgium (Dutch)</option> <option <%=(strSiteId.equals("EBAY-PH"))?"selected":""%> value="EBAY-PH">Philippines</option> <option <%=(strSiteId.equals("EBAY-PL"))?"selected":""%> value="EBAY-PL">Poland</option> <option <%=(strSiteId.equals("EBAY-SG"))?"selected":""%> value="EBAY-SG">Singapore</option> <option <%=(strSiteId.equals("EBAY-SE"))?"selected":""%> value="EBAY-SE">Sweden</option> <option <%=(strSiteId.equals("EBAY-MY"))?"selected":""%> value="EBAY-MY">Malaysia</option> <option <%=(strSiteId.equals("EBAY-US"))?"selected":""%> value="EBAY-US">United States</option> </select> </td> <td> <select name="Category" > <option value="100" ><%= result%></option> </select> </td> <td> <label> <input type="button" value="Start" onclick="run()"/></label></td> </tr> </table> </form> </div> <div id="footer"> <p>Footer</p> </div> <!-- the end of container--></div> <script type="text/javascript"> function getXmlHttpRequest() { try { // Firefox, Opera 8.0+, Safari return new XMLHttpRequest(); } catch (e) { // Internet Explorer try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return null; } } } } function setLocation(location) { strSiteId = location; var xmlHttp = getXmlHttpRequest(); xmlHttp.open("GET","app/messages/location/" + location,true); xmlHttp.send(null); } function setCategory(category) { var xmlHttp = getXmlHttpRequest(); xmlHttp.open("GET","app/messages/category/" + category, true); xmlHttp.send(null); } function setMessage(index) { var xmlHttp = getXmlHttpRequest(); //alert(index) xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { // document.write(xmlHttp.responseText.indexOf("<body>")); if(xmlHttp.responseText.indexOf("<body>") != -1) { s = xmlHttp.responseText.substring(xmlHttp.responseText.indexOf("<body>") + 6, xmlHttp.responseText.indexOf("</body>")) document.getElementById("output").innerHTML=s; } else { document.getElementById("output").innerHTML=xmlHttp.responseText; } pushSubmit() // submits form } } xmlHttp.open("GET","app/messages/" + index,true); xmlHttp.send(null); } function run(){ setCategory(document.form1.Category.value) setLocation(document.form1.siteId.value) setMessage(document.form1.message.value) alert(document.form1.Category.value+" "+document.form1.siteId.value+ " "+document.form1.message.value) } function pushSubmit() { document.getElementById('form1').submit(); } </script> <% // sessionObj = null; //arlItems = null; //session.removeAttribute("items"); //session.removeAttribute("siteId"); %> <h3>result</h3> <div id="output" style="border: 1px solid black; color: black; height: 18em; width: 100%"></div> </body> </html> i need to keep an iframe in focus at all times, AND i need this to work in IE 5.5+ and Firefox if other browsers are included with the same snipplet of code, i'm not going to object! i've tried the below script which keeps the iframe in focus when clicking on the base html page, but still goes out of focus when a viewer clicks on the flash object. <script> document.getElementById('myIframe').focus(); document.getElementById('flashcontent').blur(); </script> thoughts? chris<pixelmonkey> Greetings All - I've been here before and plan on being around a lot more as I've bitten off a little bit more than I can chew with overhauling my school district's website. Thanks for all the help you offer! I've got the page at http://joomla.ridgway.k12.co.us looking pretty good but for some reason the sub level navigation for About Us and Secondary disappear before I can get to a link. I believe this is a focus problem, but in my efforts I can't fix it. Can someone point me in the direction where I could fix this? Thanks for your time. Hi All, In a javascript function I am getting the selected html content using document.selection.createRange().htmlText . I am manipulating this and putting it back into the page. When I did that, the focus on the selected text was removed. I guess it lost the initial text range. How can I retain the focus? Hi all, I am wondering if anyone know how to have a link, once clicked, open a popup window WHILE also changing the page in the existing window. I know how to code them separately, but I do not know how to combine the two actions. HTML Code: <A HREF="javascript:popUp('popup.html')">link name</A> My site currently uses the above code to open popup windows. Any help would be much appreciated, David I have a html table in my web page, and this table contains some input elements (like text box, btton etc) as cell data. I have implemeted a functionality to navigate through each cell by arrow keys. Now i want to set the focus to the cell data (button or textbox) with arrow key navigation. html table code snippet - <td id="testTd"><input id="testButton" type="button" value="test" onclick="alert('test clicked!!')"/></td> While navigating through keyboard i get the id of button but when i try to set focus, it does not seem to be working javascript code snippet - var td = tabMatrix[rmove][cmove].firstChild; alert(td.id); // here i get the id of button var button = document.getElementById(td.id); button.focus; any help or pointers would be of great help. I have some anchor tags in my user control ...now when i use tab key from key board and navigate to this anchor and press enter it opens a new window and after i am done with this new window (let's say i close it)and again press tab key the focus is moving out to another element in the control but not back to the same anchor. Instead of key board if i use mouse click and then press tab key the focus is coming back to the same anchor. How can i set the focus back on to the same anchor while i use key board tab. I am working on an HTML form that has 4 buttons: Not Me (to signify that the information returned at the top of the form is not correct), then there are additional fields and three more buttons at the bottom of the form: Clear, Cancel and Submit. Looks like Greg Norman 44 This Lane Someplace, NN 00000 [NOT ME] Comments [ ] Donation [ ] CC Number [ ] [CLEAR] [CANCEL] [SUBMIT] I want to place the cursor in the first field, which I can do with javascript (document.getElementById('1').focus()), but when I do the NOT ME button highlights as the button in focus. If any button has to retain focus, I want it to be the SUBMIT button, not the first button on the page. However, if I control the cursor and insert it into the first field, I can't seem to get control of the button independently. I have tried many things, including assigning ID, tab order, and even creating the buttons with javascript separately, but the browser seems to demand focus on that first button even when I remove the focus from the button before placing the cursor: window.document.focus document.getElementById('1').focus() Is there a separate commend by which I can control the focus of the buttons ? Is there a way to set focus on two items at the same time (i.e., the correct button and the entry field)? I am using CSS and feildsets to define a custom look for the forms, but I assume that really doesn't make a difference. ANY IDEAS? For some reason when I click on my simple input box, the input box does not accept focus. Has anyone seen this before? I have tried some javascript, but shouldn't need to! Here is a link to the webpage: www laudontech com / garmin Here is my code: <form name="form1" method="POST" action="test5.php5"> </br> <P ALIGN=CENTER> <INPUT TYPE = "TEXT" VALUE ="Enter a search term" NAME="SearchItem" ID="SearchItem" onfocus="clearDefault(this)" onclick="set_focus()" > <INPUT TYPE = "Submit" Name = "Submit1" VALUE = "Find"> Thanks in advance, Mapper Hi, I'm trying to make a text input in a form automatically focus when the page is loaded. I know i can't use onLoad directly in the input tag and, searching on the web, i found that i have to use onLoad on the body element - something like this: <body OnLoad="document.myform.mytextfield.focus();"> The problem is i have multiple text inputs sharing the same name (they are cells in a table) so i can't use the input's name. But i do know it's the last element with that name (the last row in the table). So, how can i focus it? I hope you can help me, everything i tried didn't work. Thank you. Here is the case. I have an HTML page that opens a pop-up. Within the popup I need upon click to open a new window. The code is as it should be according to all references: <a href="some url" target="_blank">text</a> Everything is ok with IE6 and IE7 - a new window is being opened. What happens in Firefox is very strange - tabs are shown and the currently opened popup becomes one of the tabs and the new window opens in a new tab of the pop-up window instead in a new normal window. Did anybody encounter the same problem? Any solutions? hi all, i included "http://www.mapsofindia.com/pincode/index.html" page in my web page & now want to focus on search zip code table but don't know how to focus on that table.can any 1 help. I am waiting. I have a site I'm working on, and I have a flash demo movie that users can view. However, in Internet Explorer (so I'm told) You have to click once to "focus" on the flash movie, then you have to click again on the actual play button. You can view the problem from IE6 he (not sure about IE7) Click on the "view online demo" button below the header, and the movie slides out. http://www.jhilgert.com/EM/ I would like IE to focus on the movie without clicking, so users only have to click once to "play" the movie. Any help is greatly appreciated, and feel free to talk to me like I'm a fifth grader, I really would like to understand this. Hi all, I have two html file (first.html and second.html) i called the first.html from batch Command file, then the batch file calls the second.html file. what i want is that while loading the second.html it will close the first.html using script. If its a parent then i can use top.close() or parent.close() but its not a parent window. Here no parent file. please help me to do this. Thanks Jay Hi, I want to change the background color of my textbox on focus and change it back to white on onblur event. Issue: When i change the back ground color for text box on focus it properly changes it. But when i leave the focus from textbox border color for text box is impacted and its changed to white. Please help so that border color for textbox is not impacted only background color should change here is the sample code <code> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <p> <input name="text1" type="text" id="text1" value="textbox 1" onfocus="this.style.background ='#cad5df'" onblur="this.style.background='white'"> </p> <p> <input name="text2" type="text" id="text2" value="textbox 2" onFocus="this.style.background = 'yellow'" onBlur="this.style.background='white'"> </p> </body> </html> </code> |