get value with document.write

how can i get the value in the textfield ?
I wrote

document.write("<BR>xid in textfieldf is +"+XIDform.xid.value)

it doesn't work !
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

if you defined your form this way:

<form name='XIDform'>
<input type=text name='xid'>

you should get the value this way (from the same HTML):

document.write("<BR>xid in textfieldf is :"+document.XIDform.xid.value)

if this still does't work, post your whole script... ok!?

good luck!!


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mmouriesAuthor Commented:
yah it works thanks

in the same doc i write in VB Script

   Response.Write("<td><input type=""text"" size=20 maxlength=8 value=+document.XIDform.xid.value name=""user""></td>")

but it doesn't work, can u help ?
Response.Write("<td><input type=text size=20 maxlength=8 value='"+document.XIDform.xid.value+"' name='user'></td>")
mmouriesAuthor Commented:

i tried it but i had :

Microsoft VBScript runtime error '800a01a8'

Object required: 'document'

Thanks, i will give up that VB Script :)
mmouriesAuthor Commented:
look at the complete page :

document.write("Your xid is "+xid);
document.write("<FORM name=\"XIDform\"><INPUT TYPE=\"hidden\" NAME=\"xid\" VALUE="+xid+"></form>");
document.write("<br>Your host name is "+host);
document.write("<BR>Your IP address is "+ip);
document.write("<BR>xid in textfieldf is :"+document.XIDform.xid.value);
document.write("<BR>Your xid address in tf is "+document.XIDform.xid.value);
document.write("<FORM name=\"test\"><INPUT TYPE=\"text\" NAME=\"id\" VALUE="+document.XIDform.xid.value+"></form>");
<FORM name="test2"><INPUT TYPE="text" NAME="id" VALUE="+document.XIDform.xid.value+"></form>
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.