Question : Asp Help

hi any one can help me?

i have 2 textbox, txtblackPages and txtcolourPages  and i am using "onkeyup = "ValidateText(this)"" method to validate the two textbox. i want to know how to get the two textbox information in the textbox and get the sum of it e.g.

txtblackPages = 200 + txtcolourpage = 100
the sum is 300

here's my code:

function ValidateText(i)
{  
    if(i.value.length>0)
    {
      i.value = i.value.replace(/[^\d]+/g, '');
       var a = Number(i.value.replace(/[^\d]+/g, ''));
       var a = Number(a*1.00);
       var b = Number(document.getElementById('txtCPages').value);
       var b = Number(b*2.00);
       var d = Number(document.getElementById('txtCopiespages').value);
       var c = (a+b)*d;
       document.getElementById('lblTotalPrinting').innerText =(c).toFixed(2);
       
       var bindings = Number(document.getElementById('lblBinding').value);
       var extra = Number(document.getElementById('lblextra').value);
       var delivery = Number(document.getElementById('lblDelivery').value);
       
       document.getElementById('lblTotlalThesisCost').innerText =(c +  bindings +extra + delivery).toFixed(2);
    }
    else
    {
        var txtcolo= Number(document.getElementById('txtCPages').value);
        txtcolo = txtcolo * 2.00;
        document.getElementById('lblTotalPrinting').innerText = (txtcolo).toFixed(2);
       
        var bindings = Number(document.getElementById('lblBinding').value);
        var extra = Number(document.getElementById('lblextra').value);
        var delivery = Number(document.getElementById('lblDelivery').value);
       
        document.getElementById('lblTotlalThesisCost').innerText =(txtcolo +  bindings +extra + delivery).toFixed(2);
    }

}

it works fine but i also want to know how set visablity  to true and false?
e.g.

if sum > 100

txtbox1 must be visable in my function ValidateText(i) which is java

Can you help me?

Answer : Asp Help

you can set visibility through style

document.getElementById('idofelement').style.display("none"); //hide element
document.getElementById('idofelement').style.display(""); //display element

css display will make the element invisible and also hide it from the page so elements will shift as if the element you hid was gone from the page

document.getElementById('idofelement').style.visibility("hidden"); //hide element
document.getElementById('idofelement').style.visibility("visible"); //display element

css visibility will make the item invisible, but it will still hold it's place on the page

for example if you had 3 images, and you used css display property to hide the middle image, the third image would move to be next to the first image, as if there was no 2nd image there. If you used visibility to hide the middle image, then the middle image would disappear and it would look like there was an empty space the size of the middle picture between pictures 1 and 3
Random Solutions  
 
programming4us programming4us