[thelist] Javascript help please
Duncan O'Neill
dbaxo at ihug.co.nz
Thu Jan 25 03:58:31 CST 2001
Hi all,
I'm coding a client-side Javascript application(?) which has gotten
away on me.
It's designed to hold a SMALL database of employee names and info
using cookies. Yeah, I know there's probably a better way, but I
don't know any other language to code it in.
I'm using prompts for the user to input changes to the data, with
a constructor function which looks like this:
function Employee(name, age,title,salary){
this.name = name;
this.age = age;
this.title = title;
this.salary = salary;
this.promote = promote;
this.addWorker=addWorker;
}
My problem is in passing the string variable from the prompt
to tell the script WHICH employee's information to change, so
that I can eventually pass the info to the promote function
like so;
charlie.promote(new_title, salary_increase);
How do I use eval() or any other method to pass the string from
the prompt, AND change it into a variable for the promote
function?
Any help appreciated.
TIA
Duncan O'Neill
==============================================================
More information about the thelist
mailing list