Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving A Value From A Form

Status
Not open for further replies.

FontanaS

Programmer
May 1, 2001
357
US
I have the following code that will set the value on the form to another web page text box that is open.

<!--ASSIGN UPLOAD VALUE TO THE PARENT FORM-->
<script type="text/Javascript">
VAR lvvar = ????????????????????????????????;
window.opener.document.getElementById('OrderFile1').value = 'lvvar';
</script>

The variable on the form that I need to get the value is called - attach1

The form is called - frmSend

Hod do I pass the value from the form to the lvvar variable. This isn't a function so i can't add it to the header. This code should run and not be called.

THANKS!
 
Usually I use server-side script to pass value to different pages.
 
This isn't a function so i can't add it to the header. This code should run and not be called.

You'll have to place the script tag somewhere below where the form element resides. You can't pull a form element's value until after the element is on the page. For example:
Code:
<script>
//reference form element here
</script>
<form element defined here>
will result in an error as you are trying to pull the value before the element is on the page

placing your <script> tags here instead will solve your problem:
Code:
<form element defined here>
<script>
//reference form element here
</script>

save that..... you can always use the onload handler for the page to pull the value, but you have to call a function from the handler, and as you said you're not using a function this won't be possible for you....

-kaht

Looking for a puppy?

silky-icon-left.gif
[small]Silky Terriers are small, relatively odorless dogs that shed no fur and make great indoor pets.[/small]
silky-icon-right.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top