Solved

get value with document.write

Posted on 1997-12-18
5
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

739 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