Capturing Input from Text Boxes 
Author Message
 Capturing Input from Text Boxes

I would like to be able to take the data from a text box on my page and
assign that data to a jscript variable.  Any help is appreciated, thanks.

Al



Sat, 16 Mar 2002 03:00:00 GMT  
 Capturing Input from Text Boxes
Hi

var myvar=document.forms.MyForm.MyField.value;

--
Best Regards
 Vidar Petursson
http://www.icysoft.com


No matter where you go there you are
-

Quote:
> I would like to be able to take the data from a text box on my page and
> assign that data to a jscript variable.  Any help is appreciated, thanks.

> Al



Sat, 16 Mar 2002 03:00:00 GMT  
 Capturing Input from Text Boxes
I get the error message "'document' is undefined".  What do I have to do to
get access to the document object?  I thought it was a built-in object...

Al


Quote:
> Hi

> var myvar=document.forms.MyForm.MyField.value;

> --
> Best Regards
>  Vidar Petursson
> http://www.icysoft.com


> No matter where you go there you are
> -


> > I would like to be able to take the data from a text box on my page and
> > assign that data to a jscript variable.  Any help is appreciated,
thanks.

> > Al



Sat, 16 Mar 2002 03:00:00 GMT  
 Capturing Input from Text Boxes
Hi

You are probably accessing this before the document is loaded

<html>
<head>
<script language="JavaScript">
function getFormData(){
alert(document.forms.MyForm.MyField.value);

Quote:
}

</script>
</head>
<body onload="getFormData()">
<form name="MyForm">
<input type="text" value="bla" name="MyField">
</form>
</body>
</html>
--
Best Regards
 Vidar Petursson
http://www.icysoft.com


No matter where you go there you are
-

Quote:
> I get the error message "'document' is undefined".  What do I have to do
to
> get access to the document object?  I thought it was a built-in object...

> Al



> > Hi

> > var myvar=document.forms.MyForm.MyField.value;

> > --
> > Best Regards
> >  Vidar Petursson
> > http://www.icysoft.com


> > No matter where you go there you are
> > -


> > > I would like to be able to take the data from a text box on my page
and
> > > assign that data to a jscript variable.  Any help is appreciated,
> thanks.

> > > Al



Sat, 16 Mar 2002 03:00:00 GMT  
 Capturing Input from Text Boxes
Thank you, the previous code does work, however, I am still having trouble
making it interactive.  I would like to have the data from the text fields
be filled in, then wehn the user hits a push button, be stored into the
jscript variables.  Is there anyway I can do this?  Thanks in advance.

Al


Quote:
> Hi

> You are probably accessing this before the document is loaded

> <html>
> <head>
> <script language="JavaScript">
> function getFormData(){
> alert(document.forms.MyForm.MyField.value);
> }
> </script>
> </head>
> <body onload="getFormData()">
> <form name="MyForm">
> <input type="text" value="bla" name="MyField">
> </form>
> </body>
> </html>
> --
> Best Regards
>  Vidar Petursson
> http://www.icysoft.com


> No matter where you go there you are
> -


> > I get the error message "'document' is undefined".  What do I have to do
> to
> > get access to the document object?  I thought it was a built-in
object...

> > Al



> > > Hi

> > > var myvar=document.forms.MyForm.MyField.value;

> > > --
> > > Best Regards
> > >  Vidar Petursson
> > > http://www.icysoft.com


> > > No matter where you go there you are
> > > -


> > > > I would like to be able to take the data from a text box on my page
> and
> > > > assign that data to a jscript variable.  Any help is appreciated,
> > thanks.

> > > > Al



Sat, 16 Mar 2002 03:00:00 GMT  
 Capturing Input from Text Boxes
Nevermind, I figured it out. <g>  Thanks for your help.

Al


Quote:
> Thank you, the previous code does work, however, I am still having trouble
> making it interactive.  I would like to have the data from the text fields
> be filled in, then wehn the user hits a push button, be stored into the
> jscript variables.  Is there anyway I can do this?  Thanks in advance.

> Al



> > Hi

> > You are probably accessing this before the document is loaded

> > <html>
> > <head>
> > <script language="JavaScript">
> > function getFormData(){
> > alert(document.forms.MyForm.MyField.value);
> > }
> > </script>
> > </head>
> > <body onload="getFormData()">
> > <form name="MyForm">
> > <input type="text" value="bla" name="MyField">
> > </form>
> > </body>
> > </html>
> > --
> > Best Regards
> >  Vidar Petursson
> > http://www.icysoft.com


> > No matter where you go there you are
> > -


> > > I get the error message "'document' is undefined".  What do I have to
do
> > to
> > > get access to the document object?  I thought it was a built-in
> object...

> > > Al



> > > > Hi

> > > > var myvar=document.forms.MyForm.MyField.value;

> > > > --
> > > > Best Regards
> > > >  Vidar Petursson
> > > > http://www.icysoft.com


> > > > No matter where you go there you are
> > > > -


> > > > > I would like to be able to take the data from a text box on my
page
> > and
> > > > > assign that data to a jscript variable.  Any help is appreciated,
> > > thanks.

> > > > > Al



Sun, 17 Mar 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Capture cancel in input box?

2. Capturing text input

3. Text box text on new page text box

4. Validating input from input box against an array of suitable inputs

5. String truncates all but 1st word in Form Input type text box

6. IE4 browser error when the user hits the delete key on a text box input

7. How to set the curso on the first single line input text box of my page

8. Input Box Text Masking

9. input box (text) and enter key

10. In Netscape Input text boxes always wider.

11. Input Mask for HTML Form text Boxes???

12. Input into text box

 

 
Powered by phpBB® Forum Software