Basically I have a numerical value (lets say £11.60 for example) that is passed to another page (ie booking.html?price=£11.60). What I want is for that value to have a certain number added to it. The code below is what I have tried to do this, but I only get the value with the numbers added to the end of it (ie £11.605 instead of £11.65). Ive asked other forums but they couldnt help me.
Below is the code which I need help with.
I need the .replace to stay there as it filters out the random characters that appear because of “spaces” that are passed along with the other variables.
Ive tried parseint() and parsefloat() but always get NaN as a result.
Anyone know a solution?
[quote]
if ( p[0] == ‘price2’ ) {
document.getElementById(“3”).innerHTML = p[1];
document.getElementById(“77”).innerHTML = p[1];
document.getElementById(’77’).value = document.getElementById(‘3’).innerHTML;
document.getElementById(“4”).innerHTML = p[1]+ 5;
document.getElementById(‘4′).value = document.getElementById(’77’).innerHTML;
document.getElementById(“5”).innerHTML = p[1]+ 15;
document.getElementById(‘5′).value = document.getElementById(’77’).innerHTML;
document.getElementById(“3”).innerHTML = p[1].replace(‘+’, ‘ ‘).replace(‘%C2%A3’, ‘£’).replace(‘ UK’, ‘ ‘);
document.getElementById(“77”).innerHTML = p[1].replace(‘+’, ‘ ‘).replace(‘%C2%A3’, ‘£’).replace(‘ UK’, ‘ ‘);
document.getElementById(“4”).innerHTML = p[1].replace(‘+’, ‘ ‘).replace(‘%C2%A3’, ‘£’).replace(‘ UK’, ‘ ‘)+5;
document.getElementById(“5”).innerHTML = p[1].replace(‘+’, ‘ ‘).replace(‘%C2%A3’, ‘£’).replace(‘ UK’, ‘ ‘)+15;
[URL=”http://www.edgwarelocalcars.co.uk/Booking2.html?address1=garth+road+nw2%C2%A0UK&address2=high+street+ha8%C2%A0UK&price2=%C2%A313.60&addfrom=%3Cstrong%3EFrom%3A+%3C%2Fstrong%3EGarth+Rd%2C+Barnet%2C+Greater+London+NW2+2%2C+UK%3Cbr%3E+&addto=%3Cstrong%3ETo%3A+%3C%2Fstrong%3EHigh+St%2C+Greater+London+HA8+7%2C+UK+%3Cbr%3E”]http://www.edgwarelocalcars.co.uk/Booking2.html?address1=garth+road+nw2%C2%A0UK&address2=high+street+ha8%C2%A0UK&price2=%C2%A313.60&addfrom=%3Cstrong%3EFrom%3A+%3C%2Fstrong%3EGarth+Rd%2C+Barnet%2C+Greater+London+NW2+2%2C+UK%3Cbr%3E+&addto=%3Cstrong%3ETo%3A+%3C%2Fstrong%3EHigh+St%2C+Greater+London+HA8+7%2C+UK+%3Cbr%3E