Problem with Simple Function

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
khockenberry
Forum Newbie
Posts: 3
Joined: Tue Aug 02, 2011 3:33 pm

Problem with Simple Function

Post by khockenberry »

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;

}
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Problem with Simple Function

Post by pickle »

Are you getting errors? Run this function with Firebug running (or Chrome/Safari's Developer's tools).

Is the 4th argument being sent when this function is called?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply