Javascript problems

hey i nid some help…
how will i pass the value into a textfield in javascript?
im trying this one:

document.formname.inputname.value;

but this doesn’t seem to work???
an someone help me with this problem>???
thanks!