JavaScript - Browser Close Red X Button+ Popup Ok Cancel "save Or Not" +ok
Hi ,
Kindly help I have to handle the browser RED X close button in the window. The problem is that its not saving the data. before submitting/saving the data it executes the window.close() I put settime out and form on submit conditionalyy put even its not saving the data But window is closing. how can we sequentiate the save + window.close() im copying the code below. ============ window.onbeforeunload = function() { if (window.event.clientY < 0 && (window.event.clientX > (document.documentElement.clientWidth - 5) || window.event.clientX < 15)) { editedCheck(); document.BuildRequestForm.buttonClicked.value="REDX"; if( document.BuildRequestForm.measdatachanged.value=="false") { setVarZero(); fn_Close(); } else { if(confirm('Do you want to save the changes?')) { elmtForm.onsubmit = fn_Close; //document.BuildRequestForm.onsubmit=fn_Close; //setVarZero() saveMeasurement(); setTimeout('setVarZero()',1000); //window.setTimeout(function() { window.close();}, 1000); //window.setTimeout(function() { fn_Close();}, 1000); //fn_Close(); //return true; } else { return "If you want to close the window click - Leave Page";} } } } ============= browser close RED X button+ popup OK Cancel "save or not" +OK Similar TutorialsHi! I'm new to this, so please bare with me. My terminology may not be up to par. Here's the deal: - I have a button on my Flash site that opens an HTML page in a popup window. In Flash, I open the new window using Actiosnscript 2.0: Code: on (release) { getURL("example1.html", "_blank"); } - Within the popup window are links to other HTML pages. They all open in the same window. I've been using the following to create the links in Dreamweaver: Code: onClick="MM_goToURL('parent','example2.html')" - On each page, I have a "Return to Main Menu" button that should close the popup window. To do this, I have been using: Code: onClick="window.close()" - The problem is that it works differently in each browser, and I can't even get it to consistently close the window in most browsers: Internet Explorer = popup message appears, asking "Are you sure you want to close this window?" or something similar; window closes after clicking "Yes." Safari = Only closes if I'm on the original HTML page. If I click on any of the other links (note that these all open in the same window), those pages' "Return to Main Menu" buttons cease to work. However, if I keep clicking "Back" until I get to the original page, it closes. Opera = Button actually works for each page. Firefox & Chrome = Does not close the window at all. I looked into it and saw that others have used a window.opener to solve similar issues. But, since my popup window is opened using Flash/AS2, I need to find a way around it. I've tried preceding "window.close()" with "window.opener=null" (i.e. - onClick="window.opener=null; window.close()"), but I don't think I'm doing it right because it still doesn't work. I've also seen others use codes that involve functions and variables, but it is beyond my current coding knowledge to implement this. Like I said, I'm sort of new at this. Any advice would be greatly appreciated. Thank you. - PW Hi, i have an popup which is an aspx page and when i click on browser close button..., the system should check if there is any unsaved data in the form or not. If there is any unsaved data then the message should be displayed (Do you want to leave..?) with OK and Cancel button... On click of the OK button, the data should not be saved and the user should be returned parent form ie popup should be closed and return to the parent form.On click of the cancel button, the control should return to the Pop. I had tried the below code... window.onbeforeunload = close; function close() { var result=confirm("Do you really want to close this window"); if (result) { return true; } else { location.href = document.URL; } } The above code is not working ie the popup is getting closed even on click of closse button.... and when clicked on OK it is dispalying another msgbox with leave this page and Stay on this page buttons... Please help me regarding the same... suggestions welcome !!
Hi all, I'm not sure how can i do that but i think it's possible with js. What i want to do is letting visitors save the page as a html shortcut. Can i do that with JS? Or should i search an other solution by an other language? Thanks, Does anyone have a sizeable popup that will work in google chrome?? I have tried several scripts for this with no success, they all open full page.. Here is an example of what I am looking for... The problem with this is it opens a new page plus a full page popup Code: <script type="text/javascript"> <!-- function popup(url) { var is_chrome; var width = 1020; var height = 600; var left = (screen.width - width)/2; var top = (screen.height - height)/2; var params = 'width='+width+', height='+height; params += ', top='+top+', left='+left; params += ', directories=no'; params += ', location=no'; params += ', menubar=no'; params += ', resizable=yes'; params += ', scrollbars=yes'; params += ', status=no'; params += ', toolbar=no'; newwin=window.open(url,'windowname5', params); is_chrome= navigator.userAgent.toLowerCase().indexOf('chrome') > -1; if (is_chrome) {newwindow.parent.blur();} if (window.focus) {newwin.focus()} return false; } // --> </script> To open I am using Code: onclick=popup(mypage.php?id=".$row->id." I have created a page where everytime the page loads a popup window opens and diplays a message. This is done through javascripting. After the message is read the reader can close the window. The popup page is an actual html page and not a dialog box. This is fine except, everytime the visitor comes back to that page the window pops up. Is there a way to hve it where I can insert a link or button that says "Don't show message again" . That way it will pop up the first time but if the reader clicks that "Don't show message again" it will not appear again. Maybe set some sort of cookie. HELP ME PLEASE
Hi all: I've got a script that reads a line of text from a file, and does a bit of parsing to that line into an array. Apparently, this can take some time, so I get the "Stop running this script?" message. From what I understand, I need to use the setTimeout call, but for the life of me can't understand it. When I do add it to some code, it seems to work, but doesn't "pause" the code as I expect it too... Code: function ReadFile(Fname) { var path = "y:\\metrics\\"; var file, x=0, ForReading=1; file = fso.OpenTextFile(path+Fname, ForReading, false); do { var fileLine = file.readline(); var arrSplit = GetItems(fileLine); } while (!file.AtEndOfStream); file.close(); return(x); } function GetItems(recordLine) { var ItemsTemp=[]; var finishString, itemString, itemIndex, charIndex, inQuote, testChar; inQuote = false; charIndex= 0; itemIndex=0; itemString = ""; finishString = false; var count = 0; do { if (++count >= 100) { delay = setTimeout("", 1, []); count = 0; return; } testChar = recordLine.substring(charIndex,charIndex+1); finishString = false; if (inQuote) { if (testChar == "\"") { inQuote = false; finishString = true; ++charIndex; } else { itemString = itemString + testChar; } } else { if (testChar == "\"") { inQuote = true; } else if (testChar == ",") { finishString = true; } else { if (testChar == "=") { testChar = ""; } itemString = itemString + testChar; } } if (finishString) { ItemsTemp.push(itemString); itemString = ""; ++itemIndex; } ++charIndex; } while (charIndex <= recordLine.length); return(ItemsTemp); } Any help would be greatly appreciated! Thanks, Max I found this script on a tutorial site but it had no summary of browser compatibility or any other issues. I know absolutely nothing about javascript and, although it works fine when I test it, I would appreciate it very much if someone else would review this page and give me feedback. Code: <head> <script type="text/javascript"> lastone='empty'; function showIt(lyr) { if (lastone!='empty') lastone.style.display='none'; lastone=document.getElementById(lyr); lastone.style.display='block'; } </script> </head> <body> <!--links--> <a href="JavaScript:;" onClick="showIt('divID1')" ">link1</a> <a href="JavaScript:;" onClick="showIt('divID2')" ">link2</a> <a href="JavaScript:;" onClick="showIt('divID3')" ">link3</a> <a href="JavaScript:;" onClick="showIt('divID4')" ">link4</a> <!--layers--> <div id="divID1" style="display:none;">content1</div> <div id="divID2" style="display:none;">.content2</div> <div id="divID3" style="display:none;">..content3</div> <div id="divID4" style="display:none;">...content4</div> </body> Here is a demo of it in action: http://www.mousegrey.com/layers.html Unable to close the popup. Have done the best I can Can someone please help me here. Would also like to be able to display without scrolling bars Here is the link http://www.videowebmastery.com/video...ters/index.htm Cheers Hello everyone. I'm new to programming, although I've learned HTML and CSS pretty thoroughly. I think I have most of the Javascript basics down as far as definitions, but I'm getting hung up on the actual coding. I'm working on an information request form for my fiancee's business site. In it, I want to have options that users select via radio buttons. Rather than having additional input fields static on the page, I would like to program some of the radios, when clicked, to open a previously unseen option where users will then be able to type in the necessary information. More specifically, since she only works in two states, I want a third option of "other," which, when opened, will allow the user to input any other state. Then, should the radio be deselected or reset, the field would disappear again. If my understanding is correct, I think I will need to use a javascript function in the header, an HTML "div" section with ID, "onclick" and "offclick" events in the button mark-up, and the specific javascript code to call the function (getElementById?). Or maybe I'm way off. Please help. Thanks NOTE: This is not homework Hi all, I am trying to make a popup window. The current function I have simply opens a new window (i.e. window.open(url, ...)). What I've been trying to do is create an iframe, set it's attributes to "display: none" (so it's hidden), then create a DIV and copy the innerHTML of the iframe to the DIV. The problems I am having a (1) e.setAttribute('display', 'none') (where e is the iframe element) does not work. When I append it, it shows anyway. (2) The "innerHTML" of the iframe is empty, even though it shows on the screen (of course, I set e.src properly). I need a little guidance... how to do what I'm trying to do... which is basically display the contents of a URL in a DIV rather than a new document.window. The URL, by the way, is local (i.e same domain). This should be simple, but I'm not seeing it. BTW, here's the test code (which doesn't work) Code: var e = document.createElement('iframe'); e.src = url; e.setAttribute('display', 'none'); document.body.appendChild(e); alert(e.innerHTML); Thanks...... -- Roger Site in question: www.yourvancouvermortgagebroker.ca/apply On the 3rd step of this form, I want to add a "SKIP" button that will send the user to the 5th step. No clue how to do this, as someone else helped me code. Thank You! Relevant code javascript file: Code: //step 3 $('#submit_third').click(function(){ //remove classes $('#third_step input').removeClass('error').removeClass('valid'); //ckeck if inputs aren't empty var fields = $('#third_step input[type=text]'); var error = 0; fields.each(function(){ var value = $(this).val(); if( value.length<1 || value==field_values[$(this).attr('id')] || ( $(this).attr('id')=='cemail' && !emailPattern.test(value) ) ) { $(this).addClass('error'); $(this).effect("shake", { times:3 }, 50); error++; } else { $(this).addClass('valid'); } }); if(!error) { //update progress bar $('#progress_text').html('60% Complete'); $('#progress').css('width','204px'); //slide steps $('#third_step').slideUp(); $('#fourth_step').slideDown(); } else return false; }); //step 4 $('#submit_fourth').click(function(){ //remove classes $('#fourth_step input').removeClass('error').removeClass('valid'); var fields = $('#fourth_step input[type=text]'); var error = 0; fields.each(function(){ var value = $(this).val(); if( value.length<1 || value==field_values[$(this).attr('id')]) { $(this).addClass('error'); $(this).effect("shake", { times:3 }, 50); error++; } else { $(this).addClass('valid'); } }); if(!error) { //update progress bar $('#progress_text').html('80% Complete'); $('#progress').css('width','272px'); //slide steps $('#fourth_step').slideUp(); $('#fifth_step').slideDown(); } }); // step 5 $('#submit_fifth').click(function(){ //remove classes $('#fifth_step input').removeClass('error').removeClass('valid'); I need to figure out the on page button code, what I need to add to the javascript file AND what I need to add in the CSS. (css is here) Thank you SO much to whoever can help. Hi All, I am very new to HTML programming and Javascripts. What I am trying to accomplish is I have a radio button "RequiredApprovalYesNo". When the selection is "Yes", I need fields "Approver" and "ApproverEmail" to be required upon submit. I also need to make sure that a selection is made with this radio button of either Yes or No. Here is my HTML code for these three fields and was wondering if someone could show me how to code this script or, give me an example of a Radio button selection resulting in additional fields being required or not. Thank you in advance. Code: <td> <input type="radio" name="RequireApprovalYesNo" id="RequireApprovalYesNo" value="Yes">Yes <input type="radio" name="RequireApprovalYesNo" id="RequireApprovalYesNo" value="No">No </tr> <tr> <td><table width="190" border="0" align="right" cellspacing="0"> <tr> </tr> </table></td> <tr> <td colspan="3"><div align="left"><em><strong><b style= 'color: red;'>If Yes, You Must Enter an Approver with a corresponding Email:</b> </strong></em></div></td> </tr> <tr> <td height="25"><div align="right">Approver:</div></td> <td> </td> <td><input name="Approver" type="text" id="Approver" size="40";"></td> </tr> <tr> <td height="25"><div align="right"> <p>Approver's Email: </p> </div></td> <td> </td> <td><input name="ApprovalEmail" type="text" id="ApprovalEmail" size="40"></td> </tr> <tr> I'm implementing that stupid Cookie Law thing here in the UK, but I can't get the popup to close on click in IE. Every other browser is working fine. Any one know the fix? Code: <style type="text/css"> <!-- #eucookielaw { display:none } #note { position: fixed; z-index: 101; bottom: 0; left: 0; right: 0; background: #98FB98; text-align: center; vertical-align: middle; color: #2C2C2C; line-height: 2.5; overflow: hidden; -webkit-box-shadow: 0 0 5px black; -moz-box-shadow: 0 0 5px black; box-shadow: 0 0 5px black; } #note a { color: #2C2C2C; } #note img { vertical-align: middle; } #close { cursor: pointer; } @-webkit-keyframes slideDown { 0%, 100% { -webkit-transform: translateY(-50px); } 10%, 90% { -webkit-transform: translateY(0px); } } @-moz-keyframes slideDown { 0%, 100% { -moz-transform: translateY(-50px); } 10%, 90% { -moz-transform: translateY(0px); } } .cssanimations.csstransforms #note { -webkit-transform: translateY(-50px); -webkit-animation: slideDown 2.5s 1.0s 1 ease forwards; -moz-transform: translateY(-50px); -moz-animation: slideDown 2.5s 1.0s 1 ease forwards; } .cssanimations.csstransforms #close { display: none; } --> </style> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> function SetCookie(c_name,value,expiredays) { var exdate=new Date() exdate.setDate(exdate.getDate()+expiredays) document.cookie=c_name+ "=" +escape(value)+";path=/"+((expiredays==null) ? "" : ";expires="+exdate.toUTCString()) } </script> <div id="eucookielaw" > <div id="note"> <img src="/images/cookie_sm.png" alt="Cookie" border="0"> This Site Uses Cookies. :: <a rel="nofollow" href="/terms.php">Learn More</a> :: <a id="close"><u>Close this Message</u> <img src="/images/close_sm.png" alt="Close" border="0"></a> </div> <script> close = document.getElementById("close"); close.addEventListener('click', function() { note = document.getElementById("note"); note.style.display = 'none'; }, false); </script> </div> <script type="text/javascript"> $("#eucookielaw").show(); SetCookie('eucookie','eucookie',365*10) </script> Example he No Claims Discount Insurance | Car, Home, Bike and Health No Claims Bonuses Hello, I'm not really a techie but I was feeling a little adventurous this morning so I thought I'd try to follow some tips online to customize a "buy" button for some products that I'm preparing to sell online at what is currently: www.SensoryEscapeImages.Squarespace.com If you visit this site, then click on "Photo Gallery" on the top nav, then click on the 4th image to the right on the top row of thumbnails, you will see on the overlay, at the bottom, three dropdowns that I'm trying to affect. So, there are three fields presented with the Buy button: Size, Format, and Trim & Finish. If I were to select the Size of 8 x 12 in the first dropdown, the behavior that I am striving for is to only show the Formats available in that size in the second dropdown. Subsequently, each format has Trim & Finish options exclusive to that format and I'm aiming to only make those show in the Trim & Finish dropdown. But it aint working. Here's the code that I started. No laughing <left><form action="https://www.e-junkie.com/ecom/gb.php?c=cart&i=563148&cl=74166&ejc=2" target="ej_ejc" method="POST" name="condition" accept-charset="UTF-8"> <table><tr><td>Size:<select name="o1"> <option value="8 x 12">8 x 12</option> <option value="12 x 18">12 x 18</option> <option value="16 x 24">16 x 24</option> <option value="20 x 30">20 x 30</option> <option value="24 x 36">24 x 36</option> <option value="30 x 45">30 x 45</option> </select></td><td>Format:<select name="o2"> <script type="text/javascript"> if (condition.o1.options = 0) { document.write("<option value="Print $50">Print $50</option> <option value="Print on Gatorboard $80">Print on Gatorboard $80</option> <option value="Canvas $125">Canvas $125</option>"); } if (condition.o1.options = 1) { document.write("<option value="Print $90">Print $90</option> <option value="Print on Gatorboard $125">Print on Gatorboard $125</option> <option value="Canvas $145">Canvas $145</option>"); } if (condition.o1.options = 2) { document.write("<option value="Print $125">Print $125</option> <option value="Print on Gatorboard $165">Print on Gatorboard $165</option> <option value="Canvas $220">Canvas $220</option> <option value="High Def Metal Print $575">High Def Metal Print $575</option>"); } if (condition.o1.options = 3) { document.write("<option value="Print $170">Print $170</option> <option value="Print on Gatorboard $230">Print on Gatorboard $230</option> <option value="Canvas $325">Canvas $325</option> <option value="High Def Metal Print $725">High Def Metal Print $725</option>"); } if (condition.o1.options = 4) { document.write("<option value="Print $215">Print $215</option> <option value="Print on Gatorboard $300">Print on Gatorboard $300</option> <option value="Canvas $430">Canvas $430</option> <option value="High Def Metal Print $830">High Def Metal Print $830</option>"); } if (condition.o1.options = 5) { document.write("<option value="Print $250">Print $250</option> <option value="Print on Gatorboard $340">Print on Gatorboard $340</option> <option value="Canvas $535">Canvas $535</option> <option value="High Def Metal Print $1">High Def Metal Print $1</option>"); } </script></select></td> <td>Trim and Finish:<select name="o3"> <script type="text/javascript"> if (condition.o2.options = 1 || condition.o2.options = 4 || condition.o2.options = 7 || condition.o2.options = 11 || condition.o2.options = 15 || condition.o2.options = 19) { document.write("<option value="None">None</option>"); } if (condition.o2.options = 0 || condition.o2.options = 3 || condition.o2.options = 6 || condition.o2.options = 10 || condition.o2.options = 14 || condition.o2.options = 18) { document.write("<option value="1/4 Inch White Trim">1/4 Inch White Trim</option> <option value="1/4 Inch Black Trim">1/4 Inch Black Trim</option>"); } if (condition.o2.options = 2 || condition.o2.options = 5 || condition.o2.options = 8 || condition.o2.options = 12 || condition.o2.options = 16 || condition.o2.options = 20) { document.write("<option value="White Sides">White Sides</option> <option value="Black Sides">Black Sides</option> <option value="Stretched Sides">Stretched Sides</option>"); } if (condition.o2.options = 9 || condition.o2.options = 13 || condition.o2.options = 17 || condition.o2.options = 21) { document.write("<option value="Silver Recessed Frame">Silver Recessed Frame</option> <option value="Silver Frame to Edge">Silver Frame to Edge</option> <option value="Black Recessed Frame">Black Recessed Frame</option> <option value="Black Frame to Edge">Black Frame to Edge</option> <option value="Pewter Recessed Frame">Pewter Recessed Frame</option> <option value="Pewter Frame to Edge">Pewter Frame to Edge</option>"); } </script></select></td> <td><input type="image" src="http://www.e-junkie.com/ej/ej_add_to_cart.gif" border="0" alt="Add to Cart" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this.parentNode);"/> </form></td></tr></table></left> I am trying to add a pulldown menu with a button to my website. I have successfully done this with a javascript I found online here to give credit: http://www.blazonry.com/javascript/js_menu.php I tried to modify the form so it will use an image file instead of the default button. To troubleshoot I took the relevant code and put into a seperate html file. This one is using the default code from the site referenced above. This is the page published online: http://www.keylimecomputerservice.com/test/default.html Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <SCRIPT LANGUAGE="JavaScript"><!-- function openURL() { // grab index number of the selected option selInd = document.theForm.aaa.selectedIndex; // get value of the selected option goURL = document.theForm.aaa.options[selInd].value; // redirect browser to the grabbed value (here a URL) top.location.href = goURL; } //--> </SCRIPT> </head> <body> <TABLE SPAN="3" BORDER=1 CELLSPACING=0 CELLPADDING=0 align="center" WIDTH="60%"> <TR> <TD WIDTH="33%"> <center><font color="black">Choose a connection</font></center><br> <form name="theForm"> <tt> <center> <select name="aaa" size="1"> <option selected value="#"> ---------- </option> <option value="/remote/connect1.exe">Connection 1</option> <option value="/remote/connect2.exe">Connection 2</option> <option value="/remote/connect3.exe">Connection 3</option> <option value="/remote/connect4.exe">Connection 4</option> <option value="/remote/connect5.exe">Connection 5</option> <option value="/remote/connect6.exe">Connection 6</option> <option value="/remote/connect7.exe">Connection 7</option> <option value="/remote/connect8.exe">Connection 8</option> </select> </center> </TD> <TD WIDTH="33%"> <input type="button" value=" GO " onClick="openURL()"> </tt> </form> </TD> <TD WIDTH="33%"> </TD> </TR> </TABLE> </body> I then tried to change the form to use an image instead of the default button. Obviously I didn't do it right. THIS ONE DOES NOT WORK. When you choose a menu item and then click the image, it just refreshes the page. Published page: http://www.keylimecomputerservice.co.../modified.html This is the modified code.: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <SCRIPT LANGUAGE="JavaScript"><!-- function openURL() { // grab index number of the selected option selInd = document.theForm.aaa.selectedIndex; // get value of the selected option goURL = document.theForm.aaa.options[selInd].value; // redirect browser to the grabbed value (here a URL) top.location.href = goURL; } //--> </SCRIPT> </head> <body> <TABLE SPAN="3" BORDER=1 CELLSPACING=0 CELLPADDING=0 align="center"> <TR> <TD WIDTH="33%"> <center><font color="black">Choose a connection</font></center><br> <form name="theForm"> <tt> <center> <select name="aaa" size="1"> <option selected value="#"> ---------- </option> <option value="/remote/connect1.exe">Connection 1</option> <option value="/remote/connect2.exe">Connection 2</option> <option value="/remote/connect3.exe">Connection 3</option> <option value="/remote/connect4.exe">Connection 4</option> <option value="/remote/connect5.exe">Connection 5</option> <option value="/remote/connect6.exe">Connection 6</option> <option value="/remote/connect7.exe">Connection 7</option> <option value="/remote/connect8.exe">Connection 8</option> </select> </center> </TD> <TD WIDTH="33%"> <input type="image" src="connectbutton.jpg" onClick="openURL()"> </tt> </form> </TD> <TD WIDTH="33%"> </TD> </TR> </TABLE> </body> Any and all help is appreciated. Runout74 Code: <html> <body> var j=0; var temp,temp2,temp3; <script> function scor(j) { switch(j) { case 1: alert("Απαντήσατε σωστά μόνο σε μία ερώτηση.Προσπαθήστε πάλι"); break; case 2: alert("Απαντήσατε σωστά στις δύο από τις τρείς ερωτήσεις"); break; default: alert ("Συγχαρητήρια απαντήσατε σωστά και στις τρεις ερωτήσεις"); } } </script> <meta http-equiv="content-type" content="text/hmtl; charset=iso-8859-7"> <p align="center"><font size="5">Σε μία σελίδα html πόσα είναι τα μέγιστα frames που μπορούμε να τοποθετήσουμε; </p></font> <form name="for1"> <input type="radio" name="fr1"value="1" > 5 <br> <input type="radio" name="fr1"value="2" > Όσα τα pixels<br> <input type="radio" name="fr1"value="3" > Δεν υπάρχει όριο<br> <input type="button" value="Εκχώρηση Απάντησης" onClick="getVal1()"> </form> <script type = "text/javascript"> function getVal1() { for(var i=0; i<document.for1.fr1.length; i++) { if (document.for1.fr1[i].checked) { if (document.for1.fr1[i].value==2) { j++; } } } } function getVal2() { for (var i=0;i<document.for2.fr2.length;i++) { if (document.for2.fr2[i].checked) { if (document.for2.fr2[i].value==2) { j++; } } } } function getVal3() { for (var i=0;i<document.for3.fr3.length;i++) { if (document.for3.fr3[i].checked) { if (document.for3.fr3[i].value==3) { j++; } } } } </script> <p align="center"><font size="5"> Είναι απαραίτητο σε κάθε σελίδα html να υπάρχουν τα tags head και title;</p></font> <form name="for2"> <input type="radio" name="fr2" value="1"> Ναι <br> <input type="radio" name="fr2" value="2"> Όχι <br> <input type="button" value="Εκχώρηση Απάντησης" onClick="getVal2()"> </form> <p align="center"><font size="5"> Τι κάνει το εξής tag: meta http-equiv="content-type" content="text/hmtl; charset=iso-8859-7" </p></font> <form name="for3"> <input type ="radio" name="fr3" value="1"> Δημιουργεί τις προυποθέσεις για την απόκτηση τιμών <br> <input type ="radio" name="fr3" value="2"> Ισσοροπεί τις παραγράφους σε στήλες <br> <input type ="radio" name="fr3" value="3"> Επιτρέπει την κωδικοποίηση ελληνικών χαρακτήρων στην ιστοσελίδα <br> <input type="button" value="Εκχώρηση Απάντησης" onClick="getVal3()" </form> <input type ="button" value="Υπολογισμός" onClick="scor(j)"> Apart from any logical mistakes this thing i have created might have , my question is this.Why upon pressing the last button and calling the "scor(j)" function , no alerts pop up?Thanks in advance. I'm completely stumbled by this as i have no clue as what might be wrong.But then again , my experience is extremely limited This is a general question on if it's possible and how I'd go about it... I'm working on a site hosted through a blog-managing company. Sometimes their programming doesn't seem to let me do things that would normally be possible, so I have to find creative work-arounds. This time, It doesn't seem I can use javascript to change an href destination that is generated by their system. I want the user to go to a different page, when they click on that link. I can have a script find a specific href, but it can't change it for some reason. So I'm wondering if there's a way I can just have the script redirect the user if they click on that link? I know it seems like a long way round, but I don't see any other way to do this under the circumstances. Just in case it helps, here's what I thought would work, but didn't: Code: document.getElementById('elementName').href == 'http://www.newURL.com'; I am trying to manipulate a an image gallery that functions well. Now, I have the ability to pull information from a user's preference pannel and need to place it in the an href="" // And other information in each of the "src" | "url" | "alt". Any ideas would be truly helpful. This is what I am working with at the moment and it doesn't work (obviously because it is adding code inside a span). Here is what I am starting from: [CODE] var title01Span = document.getElementById('title01Span'), //Finds the id that I want prefs = new gadgets.Prefs(), // Pulls from the user's preferences yourtitle01 = prefs.getString("title01"); // Pulls the correct string from those preferences title01Span.innerHTML = yourtitle01; // replaces the span.id with that text but I need to be able to do this in the src / href / url / etc. [CODE] Thank you so much! I seriously could use as much help as possible! |