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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a value of an <input type="text"> from a popup

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hello ,
I have a window which contain a button ,when i click the button ,a popup appear.The popup contain an <input name=&quot;a&quot; type=&quot;texte&quot;>.
How to get the .value of the input &quot;a&quot; in a hidden field in the first window (the main window)
&quot;i dont now the name of the first window&quot;
thanks in advance.
 
the first window that opened the second window can be referenced by &quot;opener&quot;.
 
Onload of popup do this:
window.opener.document.parentformname.hiddenvariablename.value = document.childform.a.value;
 
<form name=&quot;form_1&quot;>
<input type=&quot;text&quot; name=&quot;value1&quot; value=&quot;MyNiceLittleValue&quot;>
</form>

<p>

<script language=&quot;JavaScript&quot;>
<!-- hide me
document.writeln(document.form1.value1.value);
// show me -->
</script>

Gives the error: &quot;document.form1 has no properties.&quot;


Anybody know why?
 
document.writeln(document.form_1.value1.value) ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
Also, I've found the javascript MUST be below the form. Otherwise it will not work at all.

Happy hunting.
 
In a text field i had some validation.when i enter some value inthe text field, and if it violates the validations,the lable of the text box should turn Red in color.Can someone help me how can i do this.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top