• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to send data from one window to another

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have a date field in a form and has a link to a calendar form. onclick it opens that small window with a calendar. What i want is that when i click on a date in the calendar it should close and the value should get into the Date Field in the main Form. Without refreshing that is.
Thanks for any help
Gul
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
parent.formname.elementname.value=yourvar;
 
Gul Khan
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks alot i will try that
 
Gul Khan
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I tried that line but it didnt work. here are my two htmls. i m calling 2.htm from 1.htm.
//-----1.htm-------------
function chk(){
window.open("2.htm","SendData","toolbar=No, location=No, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=400, height=400");
}
</script>
<body>
<form name="form1" method="post" action="">
<input name="t1" type="text" id="t1">
<input type="button" name="Button" value="check" on Click="chk()">
</form>
</body>
//------ 2.htm-----------
<script language="javascript">
function send1(){
parent.form1.t1.value="Data Sent";
}
</script>
<body>
<form name="form1" method="post" action="">
<input type="button" name="Button" value="Send" on Click="send1()">
</form>
</body>
\----------------
Anything wrong i m doign there?
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry, i gave you the wrong syntax.,,,my mistake

window.opener.document.formname.elementname.value=yourvar;
that was frame syntax i was using, man i can tell it is friday!
Eric
 
Gul Khan
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks that worked well. Have a nice weekend
Gul
 
reply
    Bookmark Topic Watch Topic
  • New Topic