• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 244
  • Last Modified:

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 !
0
mmouries
Asked:
mmouries
  • 3
  • 2
1 Solution
 
rigansenCommented:
if you defined your form this way:

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

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!!

rigansen
0
 
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 ?
0
 
rigansenCommented:
Response.Write("<td><input type=text size=20 maxlength=8 value='"+document.XIDform.xid.value+"' name='user'></td>")
0
 
mmouriesAuthor Commented:

i tried it but i had :

Microsoft VBScript runtime error '800a01a8'

Object required: 'document'

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

<script>
xid="test";
document.write("<HTML><HEAD>");
document.write("<TITLE>Login</TITLE>");
document.write("</HEAD>");
document.write("<BODY>");
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>");
</script>
       
 
<CENTER>
<FORM name="test2"><INPUT TYPE="text" NAME="id" VALUE="+document.XIDform.xid.value+"></form>
   </CENTER>    
   </BODY>
   </HTML>  
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now