Click to See Complete Forum and Search --> : make a textbox value equal to THE CONTENTS of a declared variable


llamatron
09-03-2003, 10:05 AM
Apologies if this appears in the forum/web but I did search and I couldn't find it anywhere.
It's such a simple question so sorry again :

How do I make a textbox value equal to THE CONTENTS of a declared variable.
If I have:

var myname = 'paul';

textbox1.value = myname

Then the value of texbox1 is, you guessed it, myname and NOT the contents of the variable myname i.e Paul
Please help me. It's so frustrating to be struggling with the syntax of the language when I'd rather be
struggling with code logic. I bet it's something silly like putting an & somewhere...
Thanks as ever,

Khalid Ali
09-03-2003, 11:03 AM
you are almost there,change this line
textbox1.value = myname

to

document.formName.textbox1.value ==myname

In most of the programming languages

assignement operator is single
=
character and
equal or comparison is done with
==
characters