Problem with Simple Function
Posted: Wed Aug 03, 2011 10:30 am
I'm using this function to set read only input boxes to the passed values, this code works perfect[Note these variables are being read from a DB using Php in a select option form].
The problem I'm having is only numbers being passed from the DB will display,
I try adding business[red code] and try to set the value of it but when this is done it makes the whole function not work.
function setProjectNum(num,alloHrs,tele, bus){
Pnum=num;
allocatedHrs=alloHrs;
Phone=tele;
Business=bus;
document.getElementById('projectNum').value=Pnum;
document.getElementById('allocatedHrs').value=allocatedHrs;
document.getElementById('phoneNum').value=Phone;
document.getElementById('business').value=Business;
}
The problem I'm having is only numbers being passed from the DB will display,
I try adding business[red code] and try to set the value of it but when this is done it makes the whole function not work.
function setProjectNum(num,alloHrs,tele, bus){
Pnum=num;
allocatedHrs=alloHrs;
Phone=tele;
Business=bus;
document.getElementById('projectNum').value=Pnum;
document.getElementById('allocatedHrs').value=allocatedHrs;
document.getElementById('phoneNum').value=Phone;
document.getElementById('business').value=Business;
}