hi,
i have a field witch i want to change based on what number is put in.
so if the user puts in from 0 - 749 they get a tick bow if its > 749 then dont show the box.
it seems to work if i do 0-749 i get a box, if i do from 750 - 999 i dont get a box
but if i put 1000+ i get the box??? i dont want this.
code
function costs(cos)
{
var cost= document.getElementById('erc');
var dp= document.getElementById('dpid');
var x= cost.value;
var id= dp.value
if (x >= "750"){
if(id== "4"){
document.getElementById("authorize").style.visibil ity = "hidden";
document.getElementById("hb_auth").checked = false;
document.getElementById("authorizeno").style.visib ility = "Visible";
}
if(id== "3"){
document.getElementById("authorize").style.visibil ity = "hidden";
document.getElementById("hb_auth").checked = false;
document.getElementById("authorizeno").style.visib ility = "Visible";
}
if(id== "2"){
document.getElementById("authorize").style.visibil ity = "visible";
document.getElementById("authorizeno").style.visib ility = "hidden";
}
if(id== "1"){
document.getElementById("authorize").style.visibil ity = "visible";
document.getElementById("authorizeno").style.visib ility = "hidden";
}
}else {
if(id== "4"){
document.getElementById("authorize").style.visibil ity = "hidden";
document.getElementById("authorizeno").style.visib ility = "Visible";
}
if(id== "3"){
document.getElementById("authorize").style.visibil ity = "visible";
document.getElementById("authorizeno").style.visib ility = "hidden";
}
if(id== "2"){
document.getElementById("authorize").style.visibil ity = "visible";
document.getElementById("authorizeno").style.visib ility = "hidden";
}
if(id== "1"){
document.getElementById("authorize").style.visibil ity = "visible";
document.getElementById("authorizeno").style.visib ility = "hidden";
}
}
}
html
<input type="hidden" name="dpid" id="dpid" value="<?=$thisuser->getGroupID()?>" >
<input type="number" name="hb_erc" size="20" tabindex="14" id="erc" onchange="costs();" value="<?=$info['hb_erc']?>">
<div id="authorize" style="visibility:hidden">Authorized?<input name="hb_auth" id="hb_auth" type="checkbox" value="Yes" > </div>
<div id="authorizeno" style="visibility:hidden">You are not Authorized</div>