here is the code, it is supposed to calcualte the total of the books and display them but when displayed all i get is NAN (only works in ie). This is part of my course work .
I have a form form1 where user enters two values input1 and input2. Then a function addValues () is called:
function addValues() { var var1 = parseFloat(document.form1.input1.value) var var2 = parseFloat(document.form1.input2.value) document.form1.output.value = var1 + var2 }
When I enter 4.0001 and 1.0001 the result in my script is not 5.0002 but 5.0001999999999995 Of course this is sufficiently precise in most uses, or can be rounded off. Still I have seen no other language where rounding errors are so prominent after one simple addition.
Are these errors a result of parseFloat() ? Am I missing something crucial ? Is there an easy way to increase the precision?
I cant get my cookie to work. I believe its not my javascript that is wrong. Can anyone take a look to see what i did wrong in my cookie? I have to pages dropdown1.html and dropdown2.html. Both pages have the same exact dropdown list. There is also a javascript file called script.js which makes it so you get an error if you select the same option on the second drop down list as the first. Also in the script.js i have a cookie that should run so dropdown2.html should now what was selected in dropdown1.html Can anyone see if i made a mistake in either my javascript code in my cookie? Right now I am not getting the error message if you select the same option as the first. Ill show all my code incase you need it for reference
dropdown1.html
Code:
Code:
Script.js (this is the part where I cant figure out why the error message does not appear on the second dropdown menu if user selects the same option as the first)
I have a problem, I don't know why this code doesn't work on IE ver 8 On Firefox, Chrome it is like I want, on IE - no reaction Is this some html/css problem or my fault on js? I'm sure about .js code is correct.. I think.. link html/css/js
this will not work on change. also the innerhtml wont display. please help. here is the js:
function checkemail(){ if (document.suform.email.value && document.suform.emailcheck.value) { if (document.suform.email.value == document.suform.emailcheck.value)
can i use x on top of cbe versions prior to 5? will this cause any conflicts and break anything? is there anything i need to be aware of or watch out for?
After the user types in the textboxes and press enter (with the cursor still in one of the textboxes), buttonXXX should be pressed by default.(the user is too lazy to take the cursor over to buttonXXX and click).
The problem is the top/left most button (button A) gets pressed which annoys them to death. So I tried to do this.
In the bottonA's onfocus event handle- document.forms[0].elements['buttonXXX'].focus() .
Result: ButtonXXX receives focus alright, but the code for buttonA still executes!
The following passes the test as valid, and the mouseover for the six indicated areas also work. I need various areas to link to another page, including the six mentioned. However either the MAP works by itself, or the below mouseover works, but not both. Code:
The last time I tried to ask this question...Google Groups screwed up my message and there was no subject (sorry for that - I know it's annoying).
I'm trying to learn how to develop a plug-in that allows users to display data from one site in a third party site, like Google Adwords or the Digg counter for news stories. I took a look at Digg.com and found the following:
It looks like digg is doing the following to show the number of "diggs" for a story on your website. On my page I would have the following:
I did a clean install of Windows XP on my computer and my javascript will not work. I've tried all types of browsers, I've download the Service pack 1 for XP and IE. I have download java from Sun, which I know is not javascript but it could not hurt. I have done everything I know of to fix this problem but still Javscript will not work on my windows XP. I don't know where to turn from here, Microsoft surely does not have any info about on their website....
I've written some kind of menu to display a diagram with input fields for a budget plan. A user should be able to change values, which are initially filled by a database value, and get all corresponding values filled by the program.
//value given by database showText[k].setAttribute("value", eval("liste[i][TEXT" + k + "]"));
//onchange event for the user to change the value showText[k].setAttribute("onchange", "calculate('cost" + i + "')");
//function to recalculate corresponding values function calculate(myId) { if (myId == "initial") { ... } else { myId = myId.slice(4); //getParents(myId) returns corresponding values for myId var myParents = getParents(myId); for (var i = deep; i >= 0; i--) { var sum = 0; for (var j = 0; j < myParents.length; j++) { ... for (var k = 0; k < children.length; k++) { sum += parseFloat(document.getElementById(eval("'cost" + children[k] + "'")).getAttribute("value")); }}}}}}
My Problem is: IE and Netscape always use the value initially entered by the database and not the new value entered by the user. Is there a timing or DOM problem?
When trying to use jquery 1.5 with IE 9 RC I get an error saying that at line 5460,character 4, propery or method getElementsByTagName is not supported.
I have jquery code in a default aspx page. I have tested and it works in Visual Studio Environment. I deploy the web application to the IIS. When I try to browse the aspx page, it rendered the page, but none of the jquery code runs.
It does not work in ie7!I have been trying to fix for 2 hours now! Please help. I tried using jquery 1.6.1, 1.5.2, min.validation, regular validation, i changed the buttons to input type="submit" and did everything else I could find but nothing works.When you click submit, it does not validate. It goes straight to my thank you page and I get a blank form in return.I do not know much jquery, just enough to know what I copy and paste and make some minimal changes.[code]
The previous developer who has been working here used javascript on some forms and they're not functioning properly when opened with IE (any version)
The link to the form: Quote: http://www.avis.com.lb/reservation-inquiry?group=%27Group+V+(e.g.+Renault+Kangoo)%27&cor=%27Lebanon%27&corofres=%27LEBANON%27&hr=%2709%27&monthcoll=04
On firefox, it doesn't prompt any error and as you can see, it auto selects "Lebanon" as a country and it selects the date with 3 days in between till the return date. These don't work on IE, it just shows blank.
currently working on a project involving an interactive map with various properties on it that people can find info about.
The two parts are the interactive map itself (driven by mysql) and 'more options' from a dropdown that will allow the user to hone in on specifics.
You can see what I've got thus far here.
I know that the 'more options' are returning the proper information when I force the location id number:
Code:
// BYPASSING THE MAP ID FOR TESTING PURPOSES - 1 REPRESENTS WINDSOR EAST var location = 1 ; var social_housing_type = document.getElementById('social_housing_type').value; var layout = document.getElementById('layout').value;
I am writing an Online price quoting script for Sydney logistics a storage company. I've written this and the interface looks good so far.:thumbsup: But i need it to calculate the cost of the storage they want. they input how many and for how long they want storage for four different pallet types and i want the price to appear in the text box down the bottom.:eek: Ok, here is the code...
I read a beginners book on js and now I'm working through a cookbook style book to get a hang of things, I came across an example for redirecting URLs in the book that didn't work:
Why doesn't the following code work in firefox: var e = document.createElement("Div"); e.innerHTML = "<p>Hi</p>"; GP.appendChild(e); ..GP is a div.. It works in IE. What is the correct code for FF.