Solved

get value with document.write

Posted on 1997-12-18
5
213 Views
Last Modified: 2006-11-17
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
Comment
Question by:mmouries
  • 3
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
rigansen earned 50 total points
ID: 1276878
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
 

Author Comment

by:mmouries
ID: 1276879
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
 
LVL 2

Expert Comment

by:rigansen
ID: 1276880
Response.Write("<td><input type=text size=20 maxlength=8 value='"+document.XIDform.xid.value+"' name='user'></td>")
0
 

Author Comment

by:mmouries
ID: 1276881

i tried it but i had :

Microsoft VBScript runtime error '800a01a8'

Object required: 'document'

Thanks, i will give up that VB Script :)
0
 

Author Comment

by:mmouries
ID: 1276882
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now