Solved

get value with document.write

Posted on 1997-12-18
5
207 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
Comment Utility
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
Comment Utility
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
Comment Utility
Response.Write("<td><input type=text size=20 maxlength=8 value='"+document.XIDform.xid.value+"' name='user'></td>")
0
 

Author Comment

by:mmouries
Comment Utility

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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
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…

772 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

11 Experts available now in Live!

Get 1:1 Help Now