JavaScript - Cr And Lf Issue In Firefox
I'm developing a FlashCard App for Mozilla based browsers, and i seem to be having a strange problem. When i goto write the data file, it for some reason is not writing the CR and LF. In the datafile i'm just getting one long string of data.
Hopefully i can get this app functional by today. I want to get back to studying chinese while i'm bussing to work Code: <html> <head> <script language="javascript"> // Set Global Variables var Know = 0; var DontKnow = 0; var CurrentCard = 0; var ChineseCard = new Array(); var PinYinCard = new Array(); var EnglishCard = new Array(); var NumberOfCards = 0; var DataFile = "C:" + String.fromCharCode(92) + "FlashCard.txt"; var Delimeter = ","; var EndOfRecordTerminationCharacter = "."; function init() { document.getElementById("FlashCardPlayer").style.visibility = "hidden"; document.getElementById("FlashCardEditor").style.visibility = "hidden"; document.getElementById("MainMenu").style.visibility = "visible"; } function ShowPlayer() { document.getElementById("FlashCardPlayer").style.visibility = "visible"; document.getElementById("MainMenu").style.visibility = "hidden"; document.getElementById("FlashCardEditor").style.visibility = "hidden"; LoadFlashCard(); } function ShowEditor() { document.getElementById("FlashCardEditor").style.visibility = "visible"; document.getElementById("FlashCardPlayer").style.visibility = "hidden"; document.getElementById("MainMenu").style.visibility = "hidden"; } function ShowMain() { document.getElementById("MainMenu").style.visibility = "visible"; document.getElementById("FlashCardPlayer").style.visibility = "hidden"; document.getElementById("FlashCardEditor").style.visibility = "hidden"; } function btnClickShowPinYin() { document.getElementById("PinYin").value = PinYinCard[CurrentCard]; } function btnClickShowEnglish() { document.getElementById("English").value = EnglishCard[CurrentCard]; } function ClearEditor() { // Clear all the text boxes in the editor document.getElementById("EditChinese").value = ""; document.getElementById("EditPinYin").value = ""; document.getElementById("EditEnglish").value = ""; } function WriteData() { // Conicate the Record data var WriteData = document.getElementById("EditChinese").value + Delimeter + document.getElementById("EditPinYin").value + Delimeter + document.getElementById("EditEnglish").value + EndOfRecordTerminationCharacter + "\n"; // Load the data file's current contents var OldData = LoadFromDisk(DataFile); var AppendData = OldData + WriteData + "\n"; // Write the data to the file SaveToDisk(DataFile, AppendData); // Clear the TextBoxes to prepare for the next entry ClearEditor(); } var Records = new Array(); var Elements = new Array(); function LoadFlashCard() { // Load the FlashCard Information from the DataFile into the Arrays LoadData = LoadFromDisk(DataFile); // Loop through the String and record the locations of the delimeters // Split the data string into records Records = LoadData.split("."); // Split the Records into Elements for (var x = 0; x <= Records.length; x++) { Elements = Records[x].split(","); } // Load the Elements in to the ChineseText, PinYin, and English Arrays NumberOfCards = 3 / Elements.length; // Load the Chinese Characters "12, 123, 1234, 12345, 123456, 1234567 var Ptr = 0; for (var x = 0; x < Records.length; x = x + 3) { ChineseCard[Ptr] = Elements[x]; Ptr++; } Ptr = 0; // Load the PinYin for (var x = 1; x < Records.length; x = x + 3) { PinYinCard[Ptr] = Elements[x]; Ptr++; } Ptr = 0; // Load the English for (var x = 2; x < Records.length; x = x + 3) { EnglishCard[Ptr] = Elements[x]; Ptr++; } } function btnClickKnow() { Know = Know + 1; if(CurrentCard == NumberOfCards) { // Display the score alert("You scored " + Know + " out of " + NumberOfCards); CurrentCard = 0; Know = 0; DontKnow = 0; // clear all textboxes and put index(0) chinese character into the chinese character textbox } CurrentCard = CurrentCard + 1; document.getElementById("PinYin").value = ""; document.getElementById("English").value = ""; document.getElementById("ChineseCharacter").value = ChineseCard[CurrentCard]; } function btnClickDontKnow() { DontKnow = DontKnow + 1 if(CurrentCard == NumberOfCards) { // Display the score alert("You scored " + Know + " out of " + NumberOfCards); CurrentCard = 0; Know = 0; DontKnow = 0; // clear all textboxes and put index(0) chinese character into the chinese character textbox } CurrentCard = CurrentCard + 1; document.getElementById("PinYin").value = ""; document.getElementById("English").value = ""; document.getElementById("ChineseCharacter").value = ChineseCard[CurrentCard]; } function SaveToDisk(FileName, Content) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("Permission to save file was denied."); } var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath( FileName ); if ( file.exists() == false ) { file.create( Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 420 ); } var outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance( Components.interfaces.nsIFileOutputStream ); outputStream.init( file, 0x04 | 0x08 | 0x20, 420, 0 ); var output = Content; var result = outputStream.write( output, output.length ); outputStream.close(); } function LoadFromDisk(filePath) { if(window.Components) try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); file.initWithPath(filePath); if (!file.exists()) return(null); var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream); inputStream.init(file, 0x01, 00004, null); var sInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream); sInputStream.init(inputStream); return(sInputStream.read(sInputStream.available())); } catch(e) { //alert("Exception while attempting to load\n\n" + e); return(false); } return(null); } </script> </head> <body onload="init()"> <!-- ***************************************** Flash Card Player ***************************************** --> <div id="FlashCardPlayer" style="position: absolute; left: 0px; top: 0px;" > <input id="ChineseCharacter" type="textbox" style="position: absolute; left: 75px; top: 5px; width: 100px; height: 100px; font-size: 35px;"> <input id="PinYin" type="textbox" style="position: absolute; left: 5px; top: 110px; width: 225px;" > <input id="English" type="textbox" style="position: absolute; left: 5px; top: 135px; width: 225px;"> <input type="button" value="Know" style="position: absolute; left: 5px; top: 170px; width: 100px; height: 30px;" onclick="btnClickKnow();"> <input type="button" value="Dont Know" style="position: absolute; left: 125px; top: 170px; width: 100px; height: 30px;" onclick="btnClickDontKnow();"> <input type="button" value="PinYin" style="position: absolute; left: 5px; top: 210px; width: 100px; height: 30px;" onclick="btnClickShowPinYin();"> <input type="button" value="English" style="position: absolute; left: 125px; top: 210px; width: 100px; height: 30px;" onclick="btnClickShowEnglish();"> <a href="" style="position: absolute; left:10px; top: 245px;" onclick="ShowMain();">Home</a> <TextArea id="DataArea" style="visibility: hidden;"></TextArea> </div> <!-- ****************************************** Flashcard Editor ****************************************** --> <div id="FlashCardEditor" style="position: absolute; left: 0px; top: 0px;"> <input id="EditChinese" style="position: absolute; left: 75px; top: 5px; width: 100px; height: 100px; font-size: 35px;" type="textbox"> <input id="EditPinYin" style="position:absolute; left: 5px; top: 110px; width: 225px;" type="textbox"> <input id="EditEnglish" style="position:absolute; left: 5px; top: 135px; width: 225px;" type="textbox"> <input id="EditClearTextButton" value="Clear" style="position:absolute; left: 5px; top: 180px; width: 100px; height: 30px;" onclick="ClearEditor();" type="button"> <input name="EditOKButton" value="OK" style="position: absolute; left: 125px; top: 180px; width: 100px; height: 30px;" onclick="WriteData();" type="button"> <a href="" style="position: absolute; left:10px; top: 225px;" onclick="javascript:Alert("*sigh* i'm getting to it!");">New</a> <a href="" style="position: absolute; left:10px; top: 245px;" onclick="btnClickShowMain();">Home</a> </div> <!-- ****************************************** Define the Layer for the Main menu ****************************************** --> <div id="MainMenu" style="position: absolute; left: 0px; top: 0px;"> These are the instructions for the Flashcard App. In the future, there should be a score board and a selection of word lists and other such things. However, it's blank for now until i finish this app :) <input value="Study Flashcards" style="position: absolute; left: 50px; top: 170px; width: 120px; height: 30px;" onclick="javascript:ShowPlayer();" type="button"> <input value="Edit Flashcards" style="position: absolute; left: 50px; top: 210px; width: 120px; height: 30px;" onclick="ShowEditor();" type="button"> </div> </body> </html> Similar TutorialsHi Im Using YUI 2.4.1 and the dragdrop text box is not edited upon mouse click in FireFox 3.0 where as it works fine in IE. I iwsh i would get some light on this. the file used is dragsrop-min.js How you handle back button scenario in firefox browser. The problem is when i click browser back button , the javascript on load is not executed and page is rendered from cache. It works in IE.. Hello all, I'm trying to set up a web page to display a video when a user clicks on a link. So far, it works fine in IE and Chrome, but it won't work in Firefox. Any ideas? http://tinyurl.com/6u3jnq5 I am currently working on a simple site and I was looking into methods to take advantage of html partial rendering to make site maintenance easier without using a server side language. The code for the two pages is as follows: Main html page: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <link href="../css/main.css" rel="stylesheet" type="text/css"/> <link href="../css/default.css" rel="stylesheet" type="text/css"/> <title>Default</title> </head> <body> <div class="navigation" id="nav_div"> <iframe name="nav_frame" onload="loadNav()"></iframe> </div> <script type="text/javascript" language="javascript"> <!-- function loadNav() { nav_frame.location="../static_partials/navigation.htm"; } //--> </script> </body> </html> And the code of navigation.htm is: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <script type="text/javascript" language="javascript"> <!-- function iframeLoad() { parent.document.getElementById("nav_div").innerHTML = document.getElementById("navigation_divs").innerHTML; } //--> </script> <title>Navigation Partial</title> </head> <body onload="iframeLoad()"> <div id="navigation_divs"> </div> </body> </html> The works fine in IE, but in Firefox 3.5.7 the iframeLoad generates an exception. The exception states the following: Code: Permission denied for <file://> to get property Window.document from <file://>. Firefox doesn't seem to like my usage of the parent object in that way, but I am unsure of another way to do it without using a server side language. Hi i have this code that with Firefox work but with IE no; function showPhoto (trElemnt){ if(isKeySent) return; var photoID = ""; var photoIDCell = trElemnt.cells[1]; alert("photoID 1 ->" + photoIDCell.textContent); with IE " photoIDCell.textContent" is udefined. can some help to undertstand ? thanks in advance Hey people! New to using Javascript but have a problem. Working in Firefox but not in IE, and no errors flash up - it just does not work! Here is my code if anyone has the time to take a peak! What it does in Firefox is has a drop down with two options, both of which call the functions passing over the name of the items to be hidden or displayed. Works fine, but not in IE. Javascript Function: Code: <script type="text/javascript"> function showStuff(id) { document.getElementById(id).style.display = 'block'; } function hideStuff(id) { document.getElementById(id).style.display = 'none'; } </script> Form drop down to call javascript: Code: <select name="golf_package"> <option value='Yes' onClick="showStuff('Golf'); hideStuff('Accommodation')">Yes</option> <option value='No' selected='selected' onClick="showStuff('Accommodation'); hideStuff('Golf')">No</option> </select> Hide and Show date: Code: <span id="Golf" style="display: none; return: false;">HIDE BIT</span><span id="Accommodation" style="display: none; return: false;">HIDE BIT TWO </span> Any help will be much appreciated! Thanks The following extremely simply JavaScript code: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <script type="text/javascript"> onload=function(){ var n=document.getElementsByTagName('div')[0]; alert(n.innerHTML); } </script> </head> <body> <div>foo</div> </body> </html> alerts the innerHTML content in all the browsers. Except in Firefox 3.6.8, which alerts a blank value. What the f? I know that innerHTML is not a standard DOM method, but it used to be a crossbrowser one since FF 1.5, right? ------- Edit: It does not work even in case of firstChild.nodeValue or firstChild.data. FF 3.6.8 says that the DIV element has no first child, which is amazing. Hi all, I'm faced to a problem : I'm programming a styles generator for the Stylish add-on. What i want is the same thing that when i click on the button "Install with Stylish" : A Window appear to ask user if he wants to install the script with Stylish. I saved the website page on my desktop and opened it. Obviously it did not worked, nothing happens when i click. I also changed the path for javascript file in the html and so on.. There is a XMLhttprequest() function wich opens the url of the style ending by ".css". But i replaced the url by my file path ( by a locally file) and i replaced the statut (200 by 0, because i'm working on a local file). But whatever i do, nothing happens when i click. There is also a function called firecustomevent() who creates the event, but my knowledges are limited at this point. I read document on mozilla website on how to call an event but i can't get it to work. So if anybody knows how to display a windows asking the user if he wants to install the style, i will be grateful. Thanks and sorry for my bad english The url containing the javascript is a simple style url like this one : http://userstyles.org/styles/17120 where you can see the "install with stylish" button. I also attached the concerned javascript in a txt file. i have the following code being called from onsubmit event of form and it is not working in firefox. when debugging it will return at the line of code "row = parcelTable.rows(4);" Any ideas? Code: parcelTable = document.getElementById("parcelTable"); if(x=="parcel" && (ptaxd.value == "" || ppid.value == "" || puid.value == "" )){ rowCount = parcelTable.rows.length; row = parcelTable.rows(4); if(rowCount ==5){ }else{ row = parcelTable.insertRow(4); } cellCount = row.cells.length; errorCell = row.insertCell(cellCount); if(cellCount==0) errorCell = row.insertCell(cellCount+1); errorCell.innerHTML = "Must enter all three fields."; errorCell.setAttribute("id","error"); errorCell.style.color = "red"; isItGarbage = false; parcelError = true; } <form id="parcelForm" name="by_parcel" action="BasicShell" method="get" onsubmit="return validate('parcel');"> Hi buddys, I'm trying to create a rolling area on my webpage, which will rolling forever on the top corner of my webpage to show the up coming event, the following is my code, however it works in IE7 or lower, in IE 8, it only rolling one turn, in firefox, it's not moving at all!!! Can anyone help and see what shall I do with it?? Many thanks, Cat <DIV id=rolllink011 style="OVERFLOW: hidden; WIDTH: 189px; HEIGHT: 100px"> <CENTER> <DIV id=rolllink1011 style="WIDTH: 189px; HEIGHT: 120px"> <table width="100%" border="0" id="table011"> <tr> <td height ="100px" width="98%" id="TdBox011"> <p><strong>Events</strong></p> <p align="left">First Event ............Date</p> <p align="left">Second Event ........Date</p> <p align="left">Third Event ...........Date</p></td> </tr> </table> </DIV> </CENTER> <CENTER> <DIV id=rolllink2011></DIV></CENTER></DIV> <script language="Javascript"> function Marquee011(){ if(rolllink2011.offsetTop-rolllink011.scrollTop<=0) rolllink011.scrollTop-=rolllink1011.offsetHeight; else{ rolllink011.scrollTop++; } } function Start011(){ var rollspeed011=40; var rolllink1=TdBox011.offsetHeight; var temp=rolllink1; while(temp<rolllink011.offsetHeight) { document.getElementById("table011").insertRow(1); document.getElementById("table011").rows[1].insertCell(0).innerHTML=TdBox011.innerHTML; temp+=rolllink1; } rolllink2011.innerHTML=rolllink1011.innerHTML; var MyMar011=setInterval(Marquee011,rollspeed011); rolllink011.onmouseover=function() {clearInterval(MyMar011);} rolllink011.onmouseout=function() {MyMar011=setInterval(Marquee011,rollspeed011);} } setTimeout("Start011();",1000); </script> so im using firfoxes firebug and its giving me this java script error missing ; before statement document.getElementById("aia").innerHTML = "<p onclick="" >Sword</p>"; i tried just puting this ; behind the beginning but i just cant figure it out. Ok, so I spent all my time making this website http://portfolio.dreamsofatypewriter.com/index.html work on IE. And now it turns out it is Firefox that is trying to ruin me. I am using a simple JQuery by Sam Dunn to slide boxes on the upper left of the landing page. But in Firefox (may be it is just FFX4) it won't run. I can't fathom what can be the problem. Any thoughts? Thanks Sandeep Why will scripts run in IE and not in firefox. I cant find any simple Javascript code that will create a username/password login that will work in both browsers.
Hi All I have a content slider, but it only seems to work in FF and not any of the other browsers. I am using Wordpress but its not a plugin This is what I have: page.php Code: <?php if (is_front_page()) { include ("homepage-slider.php"); } ?> homepage-slider.php Code: <!-- Inner content DIVs should always carry "contentdiv" CSS class --> <!-- Pagination DIV should always carry "paginate-SLIDERID" CSS class --> <div id="slider1" class="sliderwrapper"> <div class="contentdiv"> <div class="home-div1"> <div class="home-div-logo"></div> </div> </div> <div class="contentdiv"> <div class="home-div2"> <span></span> </div> </div> <div class="contentdiv"> <div class="home-div3"> <span></span> </div> </div> </div> <div id="paginate-slider1" class="pagination" style="display:none;"> </div> <script type="text/javascript"> featuredcontentslider.init({ id: "slider1", //id of main slider DIV contentsource: ["inline", ""], //Valid values: ["inline", ""] or ["ajax", "path_to_file"] toc: "#increment", //Valid values: "#increment", "markup", ["label1", "label2", etc] nextprev: ["Previous", "Next"], //labels for "prev" and "next" links. Set to "" to hide. revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover" enablefade: [true, 0.2], //[true/false, fadedegree] autorotate: [true, 4000], //[true/false, pausetime] onChange: function(previndex, curindex){ //event handler fired whenever script changes slide //previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc) //curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc) } }) </script> There are 2 other external files : contentslider.js contentslider.css Click Here to see site. If someone could help I would really appreciate it, been bugging me big time. Cheers, Jay Hi all, This is my first post of many and am new to JS. I'm familiar with Java so I shouldn't be too lost. What I'm about to do is add support for a web app from Firefox to IE that uses OpenLayers. I've searched and found a link to this site from another thread which had a list of supported functions and what not he http://www.quirksmode.org/dom/w3c_core.html From what I've read in the last hour it seems as though I will have to use some browser sniffing (isMozilla, isIE8, etc) and have multiple conditions (if-else's) in my functions to use the proper calls. Does anyone have extra material that contains differences between IE and firefox? Someone mentioned to me that in lists IE doesn't support trailing commas but ff does.. Things like this would be very helpful Thanks, Chris Hello all, I have a property of text box which works well in firefox but not in IE ..I am unable to understand why ..andy help is appreciated ? Code: onfocus="this.style.backgroundColor='#F1CC8E';" <!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>JS: childNodes</title> <script type="text/javascript"> window.onload = function(){ var li = document.getElementsByTagName("ul")[0].childNodes; var i; var list; for (i=0; i<li.length; i++) { list = li[i]; if(list.nodeType == 1){ list.style.color = "red"; } } } </script> </head> <body> <ul> <li>List 1</li> <li>List 2</li> <li>List 3</li> <li>List 4</li> </ul> </body> </html> Is there any way (except giving ID) that we can let firefox read nodeType as element type? Because I want li[2] (List 3) to be exceptionally green with other being red I know in IE it's simpler, just li[2].style.color = "green"; But Firefox treats everything as a node. Many thanks for any help! Hi all I use the following to verify that a user has entered a number between 0 and 99 in a form: Code: function validate_number(number) { //Checks uploaded files for invalid characters and extensions if (/^([0-9]|[0-9][0-9])$/gi.test(number)) { // anything but 0-99 is disallowed return true; } return false; } It seems to work fine in all browser / machine combos except Firefox on a Mac, when entering 0 returns false (I don't know if entering other numbers also returns false.) Can anybody suggest why? Hi, I'm new to JS and been thrown in at the deepend as our developer has just left! You are dealing with a total newbie! I have the following script that is not working in FF but is fine in Chrome and IE can anyone tell me what is wrong with it please?! Code: function showTotalCost(val) { if(val=='yes') { if(document.getElementById('secondaryeventtype').value == 'adventure') { document.getElementById('totalcost').innerText = Number(parseFloat(document.getElementById('cost').value) + 100).toFixed(2) + ' (including insurance)'; } else { document.getElementById('totalcost').innerText = Number(parseFloat(document.getElementById('cost').value) + 27).toFixed(2) + ' (including insurance)'; } } else { document.getElementById('totalcost').innerText = document.getElementById('cost').value; } } Code: function calculateGroupMembers() { var iMultiplier; if(document.getElementById('txtGroup1Firstname').value != '' || document.getElementById('txtGroup1Surname').value != '' || document.getElementById('txtGroup1Email').value != '') { iMultiplier=2; } if(document.getElementById('txtGroup2Firstname').value != '' || document.getElementById('txtGroup2Surname').value != '' || document.getElementById('txtGroup2Email').value != '') { iMultiplier=3; } if(document.getElementById('txtGroup3Firstname').value != '' || document.getElementById('txtGroup3Surname').value != '' || document.getElementById('txtGroup3Email').value != '') { iMultiplier=4; } if(document.getElementById('txtGroup4Firstname').value != '' || document.getElementById('txtGroup4Surname').value != '' || document.getElementById('txtGroup4Email').value != '') { iMultiplier=5; } if(document.getElementById('txtGroup5Firstname').value != '' || document.getElementById('txtGroup5Surname').value != '' || document.getElementById('txtGroup5Email').value != '') { iMultiplier=6; } document.getElementById('totalcost').innerText = Number(parseFloat(document.getElementById('cost').value) * iMultiplier).toFixed(2) + ' (inc group members)'; } It is fired from an onblur event in the div below once the chkbox is ticked, the link to the page is https://www.doitforcharity.com/book-...eid=1990&cid=0 but you may need to progress through https://www.doitforcharity.com/book-....aspx?eid=1990 first: Code: <div id="pnlGroupBooking"> <label class="boldfieldlabel" for="chkGroupBooking">Do you wish to book for others too? </label> <input id="chkGroupBooking" type="checkbox" language="javascript" onclick="__doPostBack('chkGroupBooking','')" checked="checked" name="chkGroupBooking"> (you may book up to 5 additional people) <div id="pnlGroupBookingNames" style="border: 1px solid LightGrey; width: 500px;" styles="padding:10px;"> <strong>Group Member Names</strong> <br> <p> </p> <p> </p> <p style="vertical-align: top;"> <strong>1) </strong> <input id="txtGroup1Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup1Firstname"> <input id="txtGroup1Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup1Surname"> <input id="txtGroup1Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup1Email"> <br> <strong>2) </strong> <input id="txtGroup2Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup2Firstname"> <input id="txtGroup2Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup2Surname"> <input id="txtGroup2Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup2Email"> <br> <strong>3) </strong> <input id="txtGroup3Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup3Firstname"> <input id="txtGroup3Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup3Surname"> <input id="txtGroup3Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup3Email"> <br> <strong>4) </strong> <input id="txtGroup4Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup4Firstname"> <input id="txtGroup4Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup4Surname"> <input id="txtGroup4Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup4Email"> <br> <strong>5) </strong> <input id="txtGroup5Firstname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup5Firstname"> <input id="txtGroup5Surname" class="formfieldsmall" type="text" onblur="calculateGroupMembers();" name="txtGroup5Surname"> <input id="txtGroup5Email" class="formfield" type="text" onblur="calculateGroupMembers();" name="txtGroup5Email"> </p> </div> </div> Thanks! I have the following sample html file (attached). I am trying to display the calculated field using javascript and I created a function (I am a newbie) to do so. However, it persistently shows NaN instead of the required number. I have tried my best over a coupla hours racking my brains and the internet as to why it shows as not a number. I will appreciate any help. Thanks, |