JavaScript - Javascript Tab Menu Overlaps Eachother When Window Is Resized~
The javascript tab menu works as you can see he
http://www.mujak.com/test/tabz/ But when it is resized, it overlaps eachother. How can the tabs that overlap go underneath the other tabs when resized~?? Here is the tabcontent.js file for the JS tab menu: Code: //** Tab Content script v2.0- � Dynamic Drive DHTML code library (http://www.dynamicdrive.com) //** Updated Oct 7th, 07 to version 2.0. Contains numerous improvements: // -Added Auto Mode: Script auto rotates the tabs based on an interval, until a tab is explicitly selected // -Ability to expand/contract arbitrary DIVs on the page as the tabbed content is expanded/ contracted // -Ability to dynamically select a tab either based on its position within its peers, or its ID attribute (give the target tab one 1st) // -Ability to set where the CSS classname "selected" get assigned- either to the target tab's link ("A"), or its parent container //** Updated Feb 18th, 08 to version 2.1: Adds a "tabinstance.cycleit(dir)" method to cycle forward or backward between tabs dynamically //** Updated April 8th, 08 to version 2.2: Adds support for expanding a tab using a URL parameter (ie: http://mysite.com/tabcontent.htm?tabinterfaceid=0) ////NO NEED TO EDIT BELOW//////////////////////// function ddtabcontent(tabinterfaceid){ this.tabinterfaceid=tabinterfaceid //ID of Tab Menu main container this.tabs=document.getElementById(tabinterfaceid).getElementsByTagName("a") //Get all tab links within container this.enabletabpersistence=true this.hottabspositions=[] //Array to store position of tabs that have a "rel" attr defined, relative to all tab links, within container this.currentTabIndex=0 //Index of currently selected hot tab (tab with sub content) within hottabspositions[] array this.subcontentids=[] //Array to store ids of the sub contents ("rel" attr values) this.revcontentids=[] //Array to store ids of arbitrary contents to expand/contact as well ("rev" attr values) this.selectedClassTarget="link" //keyword to indicate which target element to assign "selected" CSS class ("linkparent" or "link") } ddtabcontent.getCookie=function(Name){ var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair if (document.cookie.match(re)) //if cookie found return document.cookie.match(re)[0].split("=")[1] //return its value return "" } ddtabcontent.setCookie=function(name, value){ document.cookie = name+"="+value+";path=/" //cookie value is domain wide (path=/) } ddtabcontent.prototype={ expandit:function(tabid_or_position){ //PUBLIC function to select a tab either by its ID or position(int) within its peers this.cancelautorun() //stop auto cycling of tabs (if running) var tabref="" try{ if (typeof tabid_or_position=="string" && document.getElementById(tabid_or_position).getAttribute("rel")) //if specified tab contains "rel" attr tabref=document.getElementById(tabid_or_position) else if (parseInt(tabid_or_position)!=NaN && this.tabs[tabid_or_position].getAttribute("rel")) //if specified tab contains "rel" attr tabref=this.tabs[tabid_or_position] } catch(err){alert("Invalid Tab ID or position entered!")} if (tabref!="") //if a valid tab is found based on function parameter this.expandtab(tabref) //expand this tab }, cycleit:function(dir, autorun){ //PUBLIC function to move foward or backwards through each hot tab (tabinstance.cycleit('foward/back') ) if (dir=="next"){ var currentTabIndex=(this.currentTabIndex<this.hottabspositions.length-1)? this.currentTabIndex+1 : 0 } else if (dir=="prev"){ var currentTabIndex=(this.currentTabIndex>0)? this.currentTabIndex-1 : this.hottabspositions.length-1 } if (typeof autorun=="undefined") //if cycleit() is being called by user, versus autorun() function this.cancelautorun() //stop auto cycling of tabs (if running) this.expandtab(this.tabs[this.hottabspositions[currentTabIndex]]) }, setpersist:function(bool){ //PUBLIC function to toggle persistence feature this.enabletabpersistence=bool }, setselectedClassTarget:function(objstr){ //PUBLIC function to set which target element to assign "selected" CSS class ("linkparent" or "link") this.selectedClassTarget=objstr || "link" }, getselectedClassTarget:function(tabref){ //Returns target element to assign "selected" CSS class to return (this.selectedClassTarget==("linkparent".toLowerCase()))? tabref.parentNode : tabref }, urlparamselect:function(tabinterfaceid){ var result=window.location.search.match(new RegExp(tabinterfaceid+"=(\\d+)", "i")) //check for "?tabinterfaceid=2" in URL return (result==null)? null : parseInt(RegExp.$1) //returns null or index, where index (int) is the selected tab's index }, expandtab:function(tabref){ var subcontentid=tabref.getAttribute("rel") //Get id of subcontent to expand //Get "rev" attr as a string of IDs in the format ",john,george,trey,etc," to easily search through var associatedrevids=(tabref.getAttribute("rev"))? ","+tabref.getAttribute("rev").replace(/\s+/, "")+"," : "" this.expandsubcontent(subcontentid) this.expandrevcontent(associatedrevids) for (var i=0; i<this.tabs.length; i++){ //Loop through all tabs, and assign only the selected tab the CSS class "selected" this.getselectedClassTarget(this.tabs[i]).className=(this.tabs[i].getAttribute("rel")==subcontentid)? "selected" : "" } if (this.enabletabpersistence) //if persistence enabled, save selected tab position(int) relative to its peers ddtabcontent.setCookie(this.tabinterfaceid, tabref.tabposition) this.setcurrenttabindex(tabref.tabposition) //remember position of selected tab within hottabspositions[] array }, expandsubcontent:function(subcontentid){ for (var i=0; i<this.subcontentids.length; i++){ var subcontent=document.getElementById(this.subcontentids[i]) //cache current subcontent obj (in for loop) subcontent.style.display=(subcontent.id==subcontentid)? "block" : "none" //"show" or hide sub content based on matching id attr value } }, expandrevcontent:function(associatedrevids){ var allrevids=this.revcontentids for (var i=0; i<allrevids.length; i++){ //Loop through rev attributes for all tabs in this tab interface //if any values stored within associatedrevids matches one within allrevids, expand that DIV, otherwise, contract it document.getElementById(allrevids[i]).style.display=(associatedrevids.indexOf(","+allrevids[i]+",")!=-1)? "block" : "none" } }, setcurrenttabindex:function(tabposition){ //store current position of tab (within hottabspositions[] array) for (var i=0; i<this.hottabspositions.length; i++){ if (tabposition==this.hottabspositions[i]){ this.currentTabIndex=i break } } }, autorun:function(){ //function to auto cycle through and select tabs based on a set interval this.cycleit('next', true) }, cancelautorun:function(){ if (typeof this.autoruntimer!="undefined") clearInterval(this.autoruntimer) }, init:function(automodeperiod){ var persistedtab=ddtabcontent.getCookie(this.tabinterfaceid) //get position of persisted tab (applicable if persistence is enabled) var selectedtab=-1 //Currently selected tab index (-1 meaning none) var selectedtabfromurl=this.urlparamselect(this.tabinterfaceid) //returns null or index from: tabcontent.htm?tabinterfaceid=index this.automodeperiod=automodeperiod || 0 for (var i=0; i<this.tabs.length; i++){ this.tabs[i].tabposition=i //remember position of tab relative to its peers if (this.tabs[i].getAttribute("rel")){ var tabinstance=this this.hottabspositions[this.hottabspositions.length]=i //store position of "hot" tab ("rel" attr defined) relative to its peers this.subcontentids[this.subcontentids.length]=this.tabs[i].getAttribute("rel") //store id of sub content ("rel" attr value) this.tabs[i].onclick=function(){ tabinstance.expandtab(this) tabinstance.cancelautorun() //stop auto cycling of tabs (if running) return false } if (this.tabs[i].getAttribute("rev")){ //if "rev" attr defined, store each value within "rev" as an array element this.revcontentids=this.revcontentids.concat(this.tabs[i].getAttribute("rev").split(/\s*,\s*/)) } if (selectedtabfromurl==i || this.enabletabpersistence && selectedtab==-1 && parseInt(persistedtab)==i || !this.enabletabpersistence && selectedtab==-1 && this.getselectedClassTarget(this.tabs[i]).className=="selected"){ selectedtab=i //Selected tab index, if found } } } //END for loop if (selectedtab!=-1) //if a valid default selected tab index is found this.expandtab(this.tabs[selectedtab]) //expand selected tab (either from URL parameter, persistent feature, or class="selected" class) else //if no valid default selected index found this.expandtab(this.tabs[this.hottabspositions[0]]) //Just select first tab that contains a "rel" attr if (parseInt(this.automodeperiod)>500 && this.hottabspositions.length>1){ this.autoruntimer=setInterval(function(){tabinstance.autorun()}, this.automodeperiod) } } //END int() function } //END Prototype assignment Here is the CSS for tabcontent.css: Code: /* ######### CSS for Shade Tabs. Remove if not using ######### */ tr { font-size:12px; } .shadetabs{ padding: 3px 0; margin-left: 0; margin-top: 1px; margin-bottom: 0; font: bold 12px Verdana; list-style-type: none; text-align: left; /*set to left, center, or right to align the menu as desired*/ } .shadetabs li{ display: inline; margin: 0; } .shadetabs li a{ text-decoration: none; position: relative; z-index: 1; padding: 3px 7px; margin-right: 3px; border: 1px solid #778; color: #2d2b2b; background: white url(shade.gif) top left repeat-x; } .shadetabs li a:visited{ color: #2d2b2b; } .shadetabs li a:hover{ text-decoration: underline; color: #2d2b2b; } .shadetabs li a.selected{ /*selected main tab style */ position: relative; top: 1px; } .shadetabs li a.selected{ /*selected main tab style */ background-image: url(shadeactive.gif); border-bottom-color: white; } .shadetabs li a.selected:hover{ /*selected main tab style */ text-decoration: none; } .tabcontenthome{ display:block; } .tabcontent{ display:none; } @media print { .tabcontent { display:block !important; } } /* ######### CSS for Inverted Modern Bricks II Tabs. Remove if not using ######### */ .modernbricksmenu2{ padding: 0; width: 362px; border-top: 5px solid #D25A0B; /*Brown color theme*/ background: transparent; voice-family: "\"}\""; voice-family: inherit; } .modernbricksmenu2 ul{ margin:0; margin-left: 10px; /*margin between first menu item and left browser edge*/ padding: 0; list-style: none; } .modernbricksmenu2 li{ display: inline; margin: 0 2px 0 0; padding: 0; text-transform:uppercase; } .modernbricksmenu2 a{ float: left; display: block; font: bold 11px Arial; color: white; text-decoration: none; margin: 0 1px 0 0; /*Margin between each menu item*/ padding: 5px 10px; background-color: black; /*Brown color theme*/ border-top: 1px solid white; } .modernbricksmenu2 a:hover{ background-color: #D25A0B; /*Brown color theme*/ color: white; } .modernbricksmenu2 a.selected{ /*currently selected tab*/ background-color: #D25A0B; /*Brown color theme*/ color: white; border-color: #D25A0B; /*Brown color theme*/ } .tabcontent{ display:none; } @media print { .tabcontent { display:block !important; } } /* ######### CSS for Indented CSS Tabs. Remove if not using ######### */ .indentmenu{ font: bold 13px Arial; width: 100%; /*leave this value as is in most cases*/ } .indentmenu ul{ margin: 0; padding: 0; float: left; /* width: 80%; width of menu*/ border-top: 1px solid navy; /*navy border*/ background: black url(indentbg.gif) center center repeat-x; } .indentmenu ul li{ display: inline; } .indentmenu ul li a{ float: left; color: white; /*text color*/ padding: 5px 11px; text-decoration: none; border-right: 1px solid navy; /*navy divider between menu items*/ } .indentmenu ul li a:visited{ color: white; } .indentmenu ul li a.selected{ color: white !important; padding-top: 6px; /*shift text down 1px*/ padding-bottom: 4px; background: black url(indentbg2.gif) center center repeat-x; } .tabcontentstyle{ /*style of tab content oontainer*/ border: 1px solid gray; width: 450px; margin-bottom: 1em; padding: 10px; } .tabcontent{ display:none; } @media print { .tabcontent { display:block !important; } } Similar TutorialsMy page is auto centered when some with a monitor bigger than what I developed for views the page. I want to add a left border to my left div tag when the screen is over a certain size. Here's what I have: the div tag is this: Code: <div class="left"></div> css Code: .left{ width: 240px; min-height: 548px; background: #97D38B; float: left; border: 0px; border-bottom: 2px; border-style: solid; border-collapse: collapse; border-color: #0F5400; } javascript: Code: window.onresize=resized; window.onload=resized; function resized(){ if (window.innerWidth) { screenWidth=window.innerWidth; } else if (document.documentElement && document.documentElement.clientWidth) { screenWidth=document.documentElement.clientWidth; } else if(document.body) { screenWidth=document.body.clientWidth; } if (screenWidth<=1015) document.getElementById('header_float').style.position = 'absolute'; else document.getElementById('header_float').style.position = 'fixed'; if (screenWidth>1015) document.getElementById('left').style.borderLeft = '2px'; } The last bit of code document.getElementById('left').style.borderLeft = '2px'; doesn't seem to work. hi guys im looking for help with a soloution that will enable me to set a divs min-height to 350px then when the window is resized it will increase over that 350 this supose to allow people with larger resoloutions to see more of the content. make sense any ideas? cheers. Using onclick=window.open function in js to open a pdf file link in a new popup window. Works fine to display the file onscreen, but not if the user wants to save the file client-side to their computer. The right-hand-button context menu for the mouse will allow the user to download, but the file saved will be a html dump file for the webpage and the name of the file will be that for the webpage. Of course I can use the easy <a href> method for download links and the mouse context menu options will be as expected, but I can only use target="-blank" or target="_self" . I need a popup window to open. Could use : oncontextmenu="alert('Left click the link to open, and then SAVE from with the pdf viewer') to advise users how to save the file, and could use "javascript: void(0)" to eliminate most mouse context menu options, so the user won't bother try. So how can I get a link to a file which can be viewed in a popup window and downloaded using mouse right-hand context menu? Any advice massively appreciated! Here is the program: http://www.1728.com/newwindow.htm Basically, I want to input a number in the input box, which assigns a number to the variable numval located at document.box1.b1. When clicking on the "new window" button, an alert displays the input box value, then another window opens and displays the integers 1 through 12 and the amount squared. I would like the new window to obtain the number from the previous window so that the new window will display integers (and their squares) from 1 to the value of numval. Hi, I'm having troube closing the main Internet Explorer window using a script called from a right click menu. The code I'm using is: Code: <script language="JavaScript"> var oWindow = window.external.menuArguments; oWindow.close(); </script> When the script calls, windows prompts to close the window, but when 'yes' is clicked the Alert sound sounds and the window remains open! If the script is called from a button on the page it will close, but I want to close any page on the internet using a right click! All help will be gratefully received. Dave. Hello, I've tried various things I've found online but cannot seem to get the right code to open the links in a drop down menu in a new window. Code: <form id="quicklinks" name="quicklinks" action=""> <select name="quicklinkitem" onchange="openWin(quicklinkitem.value)"> <option value="/lib/board.html">Select a Date</option> <option value="/lib/boardreports/03-08-12.pdf">March 8, 2012</option> <option value="/lib/boardreports/02-09-12.pdf">February 9, 2012</option> </select> </form> I appreciate any help. Elbee I am having trouble with a sub-menu of the 1st item only and can not seem to figure it out. All the others are fine. Any help is appreciated. Here is the code: var NoOffFirstLineMenus=7; // Number of first level items var LowBgColor='white'; // Background color when mouse is not over var LowSubBgColor='white'; // Background color when mouse is not over on subs var HighBgColor='black'; // Background color when mouse is over var HighSubBgColor='black'; // Background color when mouse is over on subs var FontLowColor='black'; // Font color when mouse is not over var FontSubLowColor='black'; // Font color subs when mouse is not over var FontHighColor='white'; // Font color when mouse is over var FontSubHighColor='white'; // Font color subs when mouse is over var BorderColor='black'; // Border color var BorderSubColor='black'; // Border color for subs var BorderWidth=1; // Border width var BorderBtwnElmnts=1; // Border between elements 1 or 0 var FontFamily="arial,comic sans ms,technical" // Font family menu items var FontSize=9; // Font size menu items var FontBold=1; // Bold menu items 1 or 0 var FontItalic=0; // Italic menu items 1 or 0 var MenuTextCentered='center'; // Item text position 'left', 'center' or 'right' var MenuCentered='center'; // Menu horizontal position 'left', 'center' or 'right' var MenuVerticalCentered='top'; // Menu vertical position 'top', 'middle','bottom' or static var ChildOverlap=.2; // horizontal overlap child/ parent var ChildVerticalOverlap=.2; // vertical overlap child/ parent var StartTop=05; // Menu offset x coordinate var StartLeft=05; // Menu offset y coordinate var VerCorrect=0; // Multiple frames y correction var HorCorrect=0; // Multiple frames x correction var LeftPaddng=3; // Left padding var TopPaddng=2; // Top padding var FirstLineHorizontal=1; // SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL var MenuFramesVertical=1; // Frames in cols or rows 1 or 0 var DissapearDelay=1000; // delay before menu folds in var TakeOverBgColor=1; // Menu frame takes over background color subitem frame var FirstLineFrame='navig'; // Frame where first level appears var SecLineFrame='space'; // Frame where sub levels appear var DocTargetFrame='space'; // Frame where target documents appear var TargetLoc=''; // span id for relative positioning var HideTop=0; // Hide first level when loading new document 1 or 0 var MenuWrap=1; // enables/ disables menu wrap 1 or 0 var RightToLeft=0; // enables/ disables right to left unfold 1 or 0 var UnfoldsOnClick=0; // Level 1 unfolds onclick/ onmouseover var WebMasterCheck=0; // menu tree checking on or off 1 or 0 var ShowArrow=1; // Uses arrow gifs when 1 var KeepHilite=1; // Keep selected path highligthed var Arrws=['tri.gif',5,10,'tridown.gif',10,5,'trileft.gif',5,10]; // Arrow source, width and height function BeforeStart(){return} function AfterBuild(){return} function BeforeFirstOpen(){return} function AfterCloseAll(){return} // Menu tree // MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width); // For rollover images set "Text to show" to: "rollover:Image1.jpg:Image2.jpg" Menu1=new Array("Home","","",3); Menu1_1=new Array("The Ayllu","The Ayllu.htm","",0,20,150); Menu1_2=new Array("Acknow","Acknowledgement.htm","",0); Menu1_3=new Array("Prayer","Prayer.htm","",0); Menu2=new Array("About Us","","",4); Menu2_1=new Array("Debra","bio.htm","",0,20,150); Menu2_2=new Array("Seamus","Seamus.htm","",0); Menu2_3=new Array("Locations","location.htm","",0); Menu2_4=new Array("Contact Us","contact.htm","",0); Menu3=new Array("Services","","",7); Menu3_1=new Array("Shamanic Healing","http://www.Ayllu.us/Shamanic Healing.htm","",0,20,150); Menu3_2=new Array("Shamanic Counseling","http://www.Ayllu.us/Shamanic Counseling.htm","",0); Menu3_3=new Array("Sacred Ceremonies","http://www.Ayllu.us/Sacred Ceremonies.htm","",0); Menu3_4=new Array("Sacred Body Work","http://www.Ayllu.us/sbw.htm","",0); Menu3_5=new Array("Full Moon Crystal Bowl","http://www.Ayllu.us/fm.htm","",0); Menu3_6=new Array("Sound Healing","http://www.Ayllu.us/Sound Healing.htm","",0); Menu3_7=new Array("LaHo-Chi","http://www.Ayllu.us/lahochi.htm","",0); Menu4=new Array("Calendar","http://www.ayllu.us/calendar.htm","",0); Menu5=new Array("Gallery","http://www.ayllu.us/gallery.html","",0); Menu6=new Array("Articles","","",3); Menu6_1=new Array("Test 1","http://www.Ayllu.us/blank.htm","",0,20,150); Menu6_2=new Array("Test 2","http://www.Ayllu.us/blank.htm","",0); Menu6_3=new Array("Test 3","http://www.Ayllu.us/blank.htm","",0); Menu7=new Array("Links","http://www.ayllu.us/links.htm","",0); My community runs a set of forums, (phpbb with the Brushed Metal template, if that is important.) and people often use large images in their posts. This ends up cutting off the majority of the image, so we thought we'd install an auto-resize script, to resize anything wider than 600 px. It works too well, it also resizes the banner at the top of the screen. A bunch of us hacked at it trying to get it to work, but none of us know anything about javascript, so it's not going so well. Either the script still resizes everything, or it does nothing at all. Here's the earliest version I could find. It's not the original script, however... Code: <script> onload_functions.push('resizeimg();'); function resizeimg() { if (document.getElementsByTagName) { for (i=0; i<document.getElementsByTagName('img').length; i++) { im = document.getElementsByTagName('img')[i]; if (im.source == 'http://lalala.com/lalala/lalala.png') /*PATH TO TOP BANNER THAT SHOULD NOT BE RESIZED*/ { continue; } if (im.width > 600) { im.style.width = '600px'; eval("pop" + String(i) + " = new Function(\"pop = window.open('" + im.src + "','phpbbegypt ','fullscale','width=400,height=400,scrollbars=1,resizable=1'); pop.focus();\")"); eval("im.onclick = pop" + String(i) + ";"); if (document.all) im.style.cursor = 'hand'; if (!document.all) im.style.cursor = 'pointer'; im.title = 'Click Here To See Image Full Size '; } } } } </script> We're stuck, we have no idea what to do. I currently have my code set to this: Code: <a href=\"javascript:if(confirm('Are you sure this offer is not working and wish to report it?;?')){document,location.href='report.php?offername=".$row['name']."&offerid=".$row['offerid']."';}\">Report</a> How would I make it so that: 1. It opens in a new window (target="_blank")?? 2. I can define how big that window is Thanks Hi - I don't know much about javascript, html, or web development. I have this javascript on my page (that is an iframe). <script type="text/javascript"> var site = 'http://' + 'localParameter("site_address")' <!-- window.location = site //--> </script> Note: site_address is a parameter that's passed to the page when loaded. Now, I need to make this iframe scroll down by like 50 pixels once the page is loaded. How can I do this? Thanks What i would like from someone if it can be done is when a page loads a another window will open with links to pages and then when a link is pressed the first window opens with the url of the link clicked but the navigater window still open so that the user can still use the navigator to navigate round the site and also if posible that there is 2 textbox one called title and the other called url and then a submit button and then it adds to the links in the page and is saved And philip M if you read this then if you havent already done so go to your private messages but i think that you have and your ignoring me so that fine if this post is in the wrong catorgry then please say with correct part of the forum.
hi. i am looking for help (example) to open to a new window in the original window. the original window is blocked from any user inputs. a good example is here at http://www.dominos.com/home/index.jsp and click on "locations" button. is there a special name for this window.open? thanks Hey Guys, I feel like a complete idiot posting this, but I clearly am missing something. I'm trying to open a window with the specs below but all it does is open a standard sized window. Any help would be greatly appreciated. Code: <SCRIPT LANGUAGE="javascript"> function open_window() { window.open ('https://domain.com/document.php','newwindow',config='height=418,width=590,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no') } </SCRIPT> <p><a onclick="open_window()"><img src="images/image.png" width="142" height="113" /></a></p> I'm slowly learning javascript, have a little java background. I wanted to just make a button you push to enter a prompt. The problem was I want the prompt message to print in a new window. Here is what I have. Can anyone help me with this? <html> <head> <script type="text/javascript"> function show_prompt() function openindex() { OpenWindow=window.open("", "newwin", "height=250, width=250,toolbar=no,scrollbars="+scroll+",menubar=no"); { var name=prompt("Please enter your name",""); if (name!=null && name!="") { OpenWindow.document.write("Hello " + name + "! How are you today? Welcome to my Demo page, Enjoy!"); } } } </script> </head> <body> <input type="button" onclick="show_prompt()" value="Click Me " /> </body> </html> Hello, I have an asp page to search for data. I like to open it in a new window while retain the search values. And I also can resize the window as well as set its attributes like height, width,etc. I created a js function like this: function posttopopup(formname, windowname) { if (! window.focus)return true; window.open('', windowname); formname.rel="nofollow" target=windowname; return true; } on my asp search page: <form method="post" action=search.asp" onSubmit="posttopopup(this, 'popupwindow')"> ..... <input type="button" name="Submit1" value="Search" onclick="if (isDate()) document.Search.submit();"> I keep getting errors like "document.search has no value..." What did I do wrong? Thanks. On my website, I have a domain name registration field that links to a reseller storefront and then searches for that domain name. I would like the storefront to open in a new window, instead of the parent window. I have tried to insert the target="blank tag but can not seem to get it to work. Is there another way to make that window open? I would appreciate any help to make this function work. You can see the page and field he http://websites4magicians.com/inprogress/ The field is on the left side, just below the center of the page. Thanks for the help! <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> Code: <SCRIPT type="text/Javascript"> <!-- function submitClick() { var userid = document.login.userid.value; var pin = document.login.pin.value; if (document.login.userid.value=='') { window.alert('User ID not entered'); } else if (document.login.pin.value=='') { window.alert('Pin not entered'); } else { window.alert ( "User ID: " + userid + "\nPIN: " + pin ); } } //--> </SCRIPT> </head> <body> <center><img height="120" width="240"> <h3 align="center">Please enter your User ID and PIN:</h3> <center> <table width="50%" id="Table1"> <tbody> <tr> <td width="50%" align="RIGHT">User ID:</td> <td width="50%" align="LEFT"><input type="text" name="userid" size="20"></td> </tr> <tr> <td align="RIGHT">PIN:</td> <td align="LEFT"><input type="text" name="pin" size="20"></td> </tr> <tr> <td></td> Code: <td align="LEFT"><INPUT TYPE="button" NAME="button" VALUE="Submit" onSubmit="return submitClick();"></td> </tr> </tbody> </table> </center> </center> </body> </html> I'm needing the program to use pop up windows when no user id has been entered or no pin has been entered. If both have been entered then i need it to show the user id and pin in a pop up window. Not sure where I've went wrong so any help would be much appreciated. I made a private message page that shows as a popup but the problem is it wont close itself after a 3 second (3000 millisecond) pause Code: <script type="text/javascript"> setTimeout("self.close();",3000); </script> This was the original code I found: Code: setTimeout('self.close();',30000); **FIXED** I was trying to close a tab instead of the window. The popup was a window that had a set url that could not be changed so i used a tab to access the page I wanted. Tested and works now Hi, I am working on a project in which I have to open my flash demo in a modal window. I got all the code for modal window and it is working great. The only problem is I am not able to open a flash file in modal window. Can any one guide me or suggest me how should I fix this. Thanks in advance. Vikrant |