JavaScript - How To Stop Page Reload ?
Hi,
I am using javascript function for refreshing html page. I have used [window.location.reload(true);] method to reload page from server. This code works if i use it by using Link/button etc. For Example: <input type="button" value="Refresh" onclick="window.location.reload(true);" /> But i want to refresh page when page loads. For Example: <body onload = "window.location.reload(true);> But this time, page reloads in an infinite loop. i don't know why... I have also used following function (against body onLoad) to reload and then stop, but this also does'nt work. function doLoad(){ var timeoutId = setTimeout( window.location.reload(true), 1000 ); window.clearTimeout(timeoutID); } Is there a way to stop reloading page after one refresh ? Thanks... Similar TutorialsI have a index page on which there are several iframes which point to pages from a tomcat server. Sometimes when the index page loads, most of the iframes display session expired error. When I refresh the page, all iframes load properly. I want to reload the page twice whenever I come to that page initially. I also want to reload that page twice when I come to it from another page. Any ideas are welcome. I have tried the following in the onload event ----------------- if(window.location.search.indexOf('reload')<0) window.location.replace(window.location.href+'?reload'); --------------- function loaded() { if (!navigator.fudge) { navigator.fudge = 0; } navigator.fuge++; if (navigator.fudge>1){navigator.fudge=0} else{location.reload()}; } ------------- if(readCookie('reloaded')!='Yes') { createCookie('reloaded','Yes',1); window.location.reload(); } else eraseCookie('reloaded'); function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } --------------------------- several meta tags to get the page each time from the server e.x. <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> Hi all, I'm new to javascript and html so this may be a silly question, and I'm sorry if I'm posting this in the wrong forum section. Anyway, I need some kind of javascript that will work in a framed page. Right now when I try to navigate to another framed page located elsewhere on my website it's pulling it up in that frame, so it's an ever expanding framed webpage. I need it to simply open the new page up in the whole browser, and not in the individual frame.. Any help is appreciate, (There may as well be an html solution but I couldn't find one)... Thanks. I am running a simple show hide div script as follows: Code: <script type="text/javascript"> <!-- function toggle_visibility(slideshow) { var e = document.getElementById(slideshow); if(e.style.display == 'block') e.style.display = 'none'; else e.style.display = 'block'; } //--> </script> <a href="#" onclick="toggle_visibility('slideshow');">Show Gallery + </a> <div id="slideshow" style="display:none">slideshow</div> It works but the page reloads and returns the user to the top of the page not to the "shown" div. Any way to send them back to the shown div or stop the reload? Any help would be appreciated. Thanks Hi I have created a very very simple javascript that displays random text quotes. It is in Greek but here it is anyway: http://gerogriniaris.blogspot.com It is in blogger and shows up as a gadget. My problem is that i need to make it reload by a button and at the same time go to the top of this gadget (using an anchor). The reason I want to do this is that I have been sharing this with other bloggers, but if they don't put it on top of their page, as soon as they press the button that reloads the page, they are in the top of the page and they would have to scroll down to find the quote. I have tried to use window.location.reload with window.location.hash. It works in Firefox, but not in IE. I have been trying something like that: Code: <input type="button" value="Click to refresh" style="width: 130px" onclick="window.location.hash='#something';window.location.reload()" /> As i said, this works with Firefox, but not with IE9 Also, I can't define urls beforehand because I want other people to be able to use it to their own blog or website. I suppose this is a noob question, but I have been trying to find a solution and couldn't. Please be kind... Any ideas? How can I execute this: From the dropdown list build up from mysql database (say a list of fruits). I select "Add New Fruit". This triggers it to either have a modal form to add new fruit or a table form. Once submitted, Select dropdown list RELOADS including the newly added data (fruit) without reloading the whole page which contains other form control such as textbox. There are two pages, folder/india.html folder/usa.html and dropdown menu in each page to switch between india and usa pages. india.html page sells in INR and usa.html in USD with links to shopping carts for each currency. link1(INR) link2(USD) Except the link and the currency information(selling price), contents in both the pages are same. So here comes the problem. Google hates duplicate pages! I am looking for a solution where, a single page In That Page, a dropdown menu to select currency As the currency is selected, without page reload, the link to shopping cart and the pricing also should be changed according to the selected currency. So Single page should be able to handle both the currencies. Kindly suggest me with codes as I am new to javascript. Thanks a lot Hi. I have a form and in the form is a checkbox use as a switch to hide and unhide a two textbox. When the other textbox is hide, the other is unhide such as the code below. When the user click the submit button on the first time and there is an error, it reloads and the id="fieldset.-in_honor" hide because it is set to hide initially but not empty. My problem is, I want to show the fieldset whichever is not empty after submit button is click and there is an error so user will not enter any more information to the other field. Is that possible? Please help. I have a hard time explaining it but hopefully you will get the idea. Thanks in advance and hope to hear from you as soon as possible. Code: /*toggle switch*/ <p><input type="checkbox" name="in_honor" value="" id="checkmemoriam" onclick="showHide(this.name);" />Please check to make this donation in honor of someone special.</p> /*hide textbox but unhide when the switch is on or the checbox is check*/ <fieldset id="fieldset-in_honor" class="fieldgroup" style="display:none"> <legend class="hide">In Honor Of</legend> <p>To make this donation in honor of someone special, please complete the two fields below:</p> <div class="formfield" <?php echo highlight('donate_honor_name'); ?>> <label for="donate_honor_name">Name:</label> <input id="donate_honor_name" name="donate_honor_name" class="text" type="text" value="<?php safeEcho($form['donate_honor_name'])?>" /> <?php helper_error('donate_honor_name'); ?> </div> <div class="formfield" <?php echo highlight('donate_honor_acknowledgement'); ?>> <label for="donate_honor_acknowledgement">Acknowledgement should be sent to:</label> <textarea id="donate_honor_acknowledgement" name="donate_honor_acknowledgement"><?php safeEcho($form['donate_honor_acknowledgement'])?></textarea> <?php helper_error('donate_honor_acknowledgement'); ?> </div> /*always show on first load of the page but once the checkbox is check, will need to hide and delete info entered*/ <fieldset id="fieldset-in_registration"> <label for="impact" style="font-weight:bold">B. Impact Areas</label> <table> <tr> <td style="width:380px;text-align:left"><label for="d" id="deslist4" name="deslist4">Crime and Drug Use <a href="javascript:alert('Ensuring prevention and treatment programs and appropriate support services are available to people who are at risk for drug addiction and supporting efforts to reduce crime.');">what is this?</a></label></td> <td style="float:right"> $<input id="d" name="d" class="text" type="text" value="<?php safeEcho($form['d'])?>" style="width:90px;" onChange="CalculateTotal()" /> <?php helper_error('d');?> </td> </tr> <tr> <td style="width:380px;text-align:left"><label for="e" id="deslist5" name="deslist5">Early Childhood Development <a href="javascript:alert('Children are healthy, loved, nurtured, safe and have access to quality childcare and early education. This includes programs that increase parenting skills, providing books to all children and providing developmental screening for 3 and 4 year olds.');">what is this?</a></label></td> <td style="float:right"> $<input id="e" name="e" class="text" type="text" value="<?php safeEcho($form['e'])?>" style="width:90px;" onChange="CalculateTotal()" /> <?php helper_error('e');?> </td> </tr></table> Code: /*JAVASCRIPT FUNCTION*/ function showHide() { if (document.getElementById('checkmemoriam').checked) { if (document.getElementById('TotalC').value == "0.00") { document.getElementById('fieldset-in_honor').style.display=""; // this is for showing document.getElementById('fieldset-in_registration').style.display="none"; } else { var answer = confirm("You entered a total gift designation of $" + document.getElementById('TotalC').value + ". At this time, gifts made \"in honor of someone special\" are not eligible for the designation option. Clicking the OK button will delete all your designation(s). Do you want to continue?") if (answer) { document.getElementById('TotalC').value="0.00"; document.getElementById('d').value="0"; document.getElementById('e').value="0"; document.getElementById('fieldset-in_honor').style.display=""; // this is for hiding document.getElementById('fieldset-in_registration').style.display="none"; } else { document.getElementById('checkmemoriam').checked=false; } } } else { if ((document.getElementById('donate_honor_name').value="") && (document.getElementById('donate_honor_acknowledgement').value="")) { document.getElementById('fieldset-in_honor').style.display="none"; // this is for hiding document.getElementById('fieldset-in_registration').style.display=""; } else { var answer = confirm("The field you are trying to close will delete all information you entered \"in honor of someone special\" but it will allow you to designate. Clicking the OK button will show the designation list. Do you still want to continue?") if (answer) { document.getElementById('donate_honor_name').value = ""; document.getElementById('donate_honor_acknowledgement').value = ""; document.getElementById('fieldset-in_honor').style.display="none"; // this is for hiding document.getElementById('fieldset-in_registration').style.display=""; } else { document.getElementById('checkmemoriam').checked=false; document.getElementById('fieldset-in_honor').style.display=""; // this is for showing document.getElementById('fieldset-in_registration').style.display="none"; } } } } Hi I am trying to trigger an event once the user clicks the browsers back/forward buttons, I have built a system just like facebook where if the user has javascript turned on they get the full feature of the site which includes fast switching for example if someone goes to this page "example.com/index.php" and click a link to contact.php it would change the url to "example.com/index.php#!/contact.php" but what I need to know is if there is any way to change the pages content when the user goes back and forth through the fast switch pages? something like "history.back !== -1" or something like that. If anyone can help please reply, thank you. What I would like to do is have a page with a dropdown menu, and depending on which option the user chooses from the dropdown, reload the page and display a particular iframe below the dropdown, based on the users choice. Also, a default iframe would load (the one connected to the default choice in the select box). Hopefully that makes sense. I was trying to make this work with PHP (without having the user having to click a submit button) but I couldn't find a way to make it happen.
Is there anyway to stop the page 'jumping to the top' when using a link like the below? Code: <a href="#" onClick="arrangeCards();">blah</a> .. I just want it to stay in the same position on the page & not jump to the top of the page every time a link like that is clicked. Cheers! I'm attaching my php test file but this is a JS problem. When I scroll down in the web page and the meta refresh hits, in Windows Safari and IE6/7/8 browsers, the web page re-positions back to the top. In Opera and FF the page refreshes but it stays where it is. Can someone look at my test script and see why it is not working in IE and Win Safari? My goal is to have the web page not re-position to the top on the auto refresh. Thanks... hi everyone, Here's part of the codes I got from our website. Right now, when someone wants to register on our website, they have to put into the Captcha after they finish all the other information. If the captcha is empty, there would be an alert; if it's wrong, the page would be refreshed, and there would be another alert, and at the same time, all the information would be lost and they have to fill them again. Now the question is, how can I stop the page refreshing itself? All I need is an alert and then you could retype the captcha without losing the other information. Thank you in advance for your advice! <script type="text/javascript"> function ltrim(stringToTrim) { return stringToTrim.replace(/^\s+/,""); } function validateForm() { var okSoFar=true with (document.practitioner_profile) { if (firstname.value=="" && okSoFar) { okSoFar=false alert("Please enter your first name.") firstname.focus() } if (lastname.value=="" && okSoFar) { okSoFar=false alert("Please enter your last name.") lastname.focus() } //some other things here... if (verify_code.value=="" && okSoFar) { okSoFar=false alert("Please enter your security code.") verify_code.focus() } if (okSoFar==true) submit(); } } //here's the submit button in the html code, <div class="practsubmit"> <div class="signupform"><h4>* Security Code:</h4> <p>Please type in what you see in the box below and press submit. Characters are case-sensitive.</p></div> <div class="signupform"><img id="captcha" src="index.php?option=com_egbcaptcha&width=150&height=50&characters=5" /><br /><input id="verify_code" name="verify_code" type="text" /></div> <input type="button" class="button" value="Send" name="B1" ONCLICK="javascript:validateForm()"> <input type="reset" class="button" value="Clear" name="clear"> </div> when i click on submit button, all the data in form will be inserted into my db. but when i click on refresh the form will be submitted again .. how can i prevent this?
Hello there I've been searching and searching but couldn't make this script stop reseting after reloading the page. The scripts counts down some timers every x hours but the problem is that each time the page is reloaded the timer resets. Could anyone help me here how to keep the countdown going even if i reload page? thanks in advance I call the timers with. Example Timer 8: >div... etc id="timeLeft8" Code: <script type="text/javascript"> var events = new Array(); events[1]={name: 'Blood Castle:', startUp: new Array( {hour:0,minute:25}, {hour:2,minute:25}, {hour:4,minute:25}, {hour:6,minute:25}, {hour:8,minute:25}, {hour:10,minute:25}, {hour:12,minute:25}, {hour:14,minute:25}, {hour:16,minute:25}, {hour:18,minute:25}, {hour:20,minute:25}, {hour:22,minute:25} )} events[2]={name: 'Devil Squa ', startUp: new Array( {hour:1,minute:55}, {hour:3,minute:55}, {hour:5,minute:55}, {hour:7,minute:55}, {hour:9,minute:55}, {hour:11,minute:55}, {hour:13,minute:55}, {hour:15,minute:55}, {hour:17,minute:55}, {hour:19,minute:55}, {hour:21,minute:55}, {hour:23,minute:55} )} events[3]={name: 'Chaos Castle:', startUp: new Array( {hour:0,minute:55}, {hour:2,minute:55}, {hour:4,minute:55}, {hour:6,minute:55}, {hour:8,minute:55}, {hour:10,minute:55}, {hour:12,minute:55}, {hour:14,minute:55}, {hour:16,minute:55}, {hour:18,minute:55}, {hour:20,minute:55}, {hour:22,minute:55} )} events[4]={name: 'Red Dragon:', startUp: new Array( {hour:0,minute:0}, {hour:2,minute:0}, {hour:4,minute:0}, {hour:6,minute:0}, {hour:8,minute:0}, {hour:10,minute:0}, {hour:12,minute:0}, {hour:14,minute:0}, {hour:16,minute:0}, {hour:18,minute:0}, {hour:20,minute:0}, {hour:22,minute:0} )} events[5]={name: 'Gold Invasion:', startUp: new Array( {hour:0,minute:0}, {hour:2,minute:0}, {hour:4,minute:0}, {hour:6,minute:0}, {hour:8,minute:0}, {hour:10,minute:0}, {hour:12,minute:0}, {hour:14,minute:0}, {hour:16,minute:0}, {hour:18,minute:0}, {hour:20,minute:0}, {hour:22,minute:0} )} events[6]={name: 'White Wizard:', startUp: new Array( {hour:0,minute:0}, {hour:2,minute:0}, {hour:4,minute:0}, {hour:6,minute:0}, {hour:8,minute:0}, {hour:10,minute:0}, {hour:12,minute:0}, {hour:14,minute:0}, {hour:16,minute:0}, {hour:18,minute:0}, {hour:20,minute:0}, {hour:22,minute:0} )} events[7]={name: 'Blue:', startUp: new Array( {hour:0,minute:40}, {hour:1,minute:40}, {hour:2,minute:40}, {hour:3,minute:40}, {hour:4,minute:40}, {hour:5,minute:40}, {hour:6,minute:40}, {hour:7,minute:40}, {hour:8,minute:40}, {hour:9,minute:40}, {hour:10,minute:40}, {hour:11,minute:40}, {hour:12,minute:40}, {hour:13,minute:40}, {hour:14,minute:40}, {hour:15,minute:40}, {hour:16,minute:40}, {hour:17,minute:40}, {hour:18,minute:40}, {hour:19,minute:40}, {hour:20,minute:40}, {hour:21,minute:40}, {hour:22,minute:40}, {hour:23,minute:40}, {hour:24,minute:40} )} events[7]={name: 'Hide&Seek:', startUp: new Array( {hour:0,minute:42}, {hour:1,minute:22}, {hour:2,minute:32}, {hour:3,minute:42}, {hour:4,minute:52}, {hour:6,minute:02}, {hour:7,minute:12}, {hour:8,minute:22}, {hour:9,minute:32}, {hour:10,minute:42}, {hour:11,minute:52}, {hour:13,minute:02}, {hour:14,minute:12}, {hour:15,minute:22}, {hour:16,minute:32}, {hour:17,minute:42}, {hour:18,minute:52}, {hour:20,minute:02}, {hour:21,minute:12}, {hour:22,minute:22}, {hour:23,minute:32} )} events[8]={name: 'Sky:', startUp: new Array( {hour:1,minute:5}, {hour:4,minute:5}, {hour:7,minute:5}, {hour:10,minute:5}, {hour:13,minute:5}, {hour:16,minute:5}, {hour:19,minute:5}, {hour:23,minute:5} )} events[9]={name: 'Boss Attack:', startUp: new Array( {hour:1,minute:50}, {hour:4,minute:50}, {hour:7,minute:50}, {hour:10,minute:50}, {hour:13,minute:50}, {hour:16,minute:50}, {hour:23,minute:50} )} events[10]={name: 'Happy Hour:', startUp: new Array( {hour:5,minute:5}, {hour:2,minute:5}, {hour:8,minute:5}, {hour:11,minute:5}, {hour:14,minute:5}, {hour:17,minute:5}, {hour:20,minute:5}, {hour:0,minute:5} )} events[11]={name: 'Hit and Up:', startUp: new Array( {hour:0,minute:20}, {hour:2,minute:20}, {hour:5,minute:20}, {hour:8,minute:20}, {hour:11,minute:20}, {hour:14,minute:20}, {hour:20,minute:20} )} events[12]={name: 'Raklion:', startUp: new Array( {hour:0,minute:15}, {hour:3,minute:15}, {hour:6,minute:15}, {hour:9,minute:15}, {hour:12,minute:15}, {hour:15,minute:15}, {hour:18,minute:15}, {hour:21,minute:15} )} events[13]={name: 'Moss:', startUp: new Array( {hour:3,minute:35}, {hour:7,minute:35}, {hour:11,minute:35}, {hour:15,minute:35}, {hour:19,minute:35}, {hour:23,minute:35} )} events[14]={name: 'Illusion Temple:', startUp: new Array( {hour:0,minute:25}, {hour:1,minute:25}, {hour:2,minute:25}, {hour:3,minute:25}, {hour:4,minute:25}, {hour:5,minute:25}, {hour:6,minute:25}, {hour:7,minute:25}, {hour:8,minute:25}, {hour:9,minute:25}, {hour:10,minute:25}, {hour:11,minute:25}, {hour:12,minute:25}, {hour:13,minute:25}, {hour:14,minute:25}, {hour:15,minute:25}, {hour:16,minute:25}, {hour:17,minute:25}, {hour:18,minute:25}, {hour:19,minute:25}, {hour:20,minute:25}, {hour:21,minute:25}, {hour:22,minute:25}, {hour:23,minute:25}, {hour:24,minute:25} )} events[15]={name: 'Castle Deep:', startUp: new Array( {hour:1,minute:25}, {hour:7,minute:25}, {hour:13,minute:25}, {hour:19,minute:25} )} events[16]={name: 'CryWolf:', startUp: new Array( {hour:1,minute:45}, {hour:4,minute:45}, {hour:7,minute:45}, {hour:10,minute:45}, {hour:13,minute:45}, {hour:16,minute:20}, {hour:19,minute:45}, {hour:22,minute:45} )} var curTime=1336998502 var dateTime=1336953600 function timeLeft(i){ for(j in events[i].startUp){ tmp=events[i].startUp[j].hour*3600+events[i].startUp[j].minute*60 if(dateTime+tmp>curTime){ return dateTime+tmp-curTime; } } tmp=events[i].startUp[0].hour*3600+events[i].startUp[0].minute*60 return dateTime+86400+tmp-curTime; } function getFormatedLeftTime($seconds){ $second = $seconds % 60; $minutes = parseInt(($seconds / 60) % 60); $hour = parseInt(($seconds / 3600) % 24); $days = parseInt($seconds / (24 * 3600)); $ret = ''; if ($days > 0) if ($days == 1) $ret += '1 day '; else $ret += $days + ' days '; if ($hour > 0){ if ($hour < 10) $hour = '0' + $hour; $ret += $hour + ':'; }else if ($days > 0) $ret += '00:'; if($minutes < 10) $minutes = '0' + $minutes; $ret += $minutes + ':'; if ($second < 10) $second = '0' + $second; $ret += $second; return $ret; } function updateTimes(){ curTime++; for (i in events){ document.getElementById("timeLeft"+i).innerHTML=getFormatedLeftTime(timeLeft(i)); } } for(i in events) document.getElementById("eventList").innerHTML+="<div style='float:right; color: #FFFF00;' id='timeLeft"+i+"'>"+getFormatedLeftTime(timeLeft(i))+"</div><div style=\"color: #00FFFF;\"><strong>"+events[i].name+"</strong></div>"; setInterval("updateTimes()", 1000); </script> I have a set of tabs that are set with an href that adds a query string to the url such as "?t=1", meaning the first tab is selected. Technically it works just fine but every time I click a tab it reloads the page and I'm not entirely sure how to stop this. I'm using a jquery plugin to handle the query strings. Here's the plugin. Here's the piece of the code that matters: Code: var url = location.search; var tab = $.query.get('t'); init(tab); function init(tab){ $("div.tab").hide(); //hides all the content boxes related to the tabs $("div#tab"+tab).fadeIn("fast"); //Shows the selected tab's content box setInactive(); //Styles unselected tabs setActive(tab); //Styles selected tab } Any help would be greatly appreciated. Probably a stupid noob question, is there any way I can stop document.write from outputting info to a new page I would prefer to have it shown in a textarea. Info from an array that is suppose to display in a text area when button is clicked and when another button is clicked it is suppose to show some other info. But what happens is the first info displays in textarea for a few seconds and then the second info is displayed but on a new page and not the textarea where I want it to go I have marked code within the code // I want this specific code to be displayed second but I know its in the wrong spot. Here is the code [CODE] function show() { var myArray = new Array(); myArray[0] = document.getElementById('fullname').value; ' myArray[1] = document.getElementById('address').value; myArray[2] = document.getElementById('phone').value; myArray[3] = document.getElementById('email').value; //Code I want to display second in the textarea //var string = myArray.join("\n") //document.getElementById('textarea').value = string; document.writeln('Thank you for registering,' + ' ' + myArray[0] + '. Your membership will be confirmed by E-mail to ' + myArray[2] + "<br>"); document.writeln('Registration Details:') document.writeln("<br>") for (var i=0; i<myArray.length; i++) { document.write(myArray[i] + "<br>"); } } [\CODE] Thanks in advance This is my dilemma and I am not sure if I am handling the right way, so please suggest a new way or provide a valid answer so that I may achieve my goal. Thanks in advance for your help in solving this matter. In short I have a single "A.html" page that uses AJAX to reload in "B.php" into a <DIV id='bDiv'> every second and "C.php" into another <DIV id='cDiv'> with no reloading. The code in B.php generates a random number between 1 and 100. If the number generated is less than 10, I want <DIV id='cDiv'> to refresh its content. I have tried a number of tricks, I could not find anything in jQuery so if there is please point me to the correct function calls. hello im working on my senior design project for my electrical engineering class. and part of the project is to upload an image via php (which ive written and it works great) but when the image is loaded into the same directory as the html file (which is supposed to display the image everytime a new image is uploaded) the image stays the same it doesnt show the new image. but i kno the new image has been uploaded because i can see it my web server. this is the code Code: <html> <head> <title>Human Cam</title> <script type = "text/javascript"> function refresh() { var refreshTime = 5*1000; //5000ms var thisImage = "Lighthouse.jpg"; //the image location var today = new Date(); //the current time //add the time to the end of the image string //to make a unique url: document.images["pic"].src=thisImage+"?"+today; //reload if the images are loaded: if (document.images) { window.onload=refresh; } //IF the time is up reload the image t=setTimeout('refresh()', refreshTime); } </script> </head> <body onload="refresh()"> <center> <h2>human cam</h2> <img src="Lighthouse.jpg" id="pic"> </center> </body> </html> Hi... I am having a problem with the resize... I use the script below to adjust the size of the frame. It works nicely for me. The only problem is, the frame initially jumps to the bookmark, and then on the reload, jumps to the top of the page. Any ideas on how to keep the frame at the bookmark in the web page, instead of jumping back up to the top???? Thanks much in advance.... <script> <!-- function resize_iframe(){ if ( window.frames["MainWindow"].document.body.scrollHeight=0 ) { } else { document.getElementById("MainWindow").height=100 document.getElementById('MainWindow').height=window.frames["MainWindow"].document.body.scrollHeight + 20 } } // --> </script> <IFRAME src="main.htm" frameborder="0" scrolling="no" ID=MainWindow NAME=MainWindow HEIGHT=800 WIDTH=1012 onLoad=resize_iframe();></IFRAME> Hey guys, I have read the past posts and I see that there have been some other people who have had issues with resetting a form. Right now - on this mess in progress - I have a function that runs on body load: Code: function load () { document.forms[0].reset(); } I know it is running because originally it was an alert, but this is not clearing the form. I need to get all checkboxes and fields to clear. I have also tried: Code: function load () { document.getElementById("regForm").reset(); } No dice. Any idea what I am missing? The temp page is he http://www.temp1.hangnailproductions...ISTRATION2.php My script is he http://www.temp1.hangnailproductions...egistration.js Thanks guys, sorry if things are clunky and sloppy, I'm doing my best but still pretty bad. -AJ |