java script help

rangan76
07-23-2002, 09:26 AM
:)

I am a beginner in Javascript. In javascript, I have a button in parent window. Using open() method i generate a form named orderWindow by clicking the button placed in parent window. orderWidow has some text boxes.Now I want to make a validation in the values entered in orderWindow. I had a idea to use " orderWindow.document.form1.text1.value. But I could not meet success. how can I retrieve the value from the function placed in parent window or otherwise how could i validate it.

Please send me.............

Williams.

Rezner
07-23-2002, 09:53 AM
Here's an example I have for how to do this:


************* sample_parent.html ********************
<html>
<head>
<title>Parent Window</title>

<script type="text/javascript" language="javascript">
prefs='toolbar=no,location=no,directories=no,status=yes,'+
'menubar=no,scrollbars=yes,resizable=yes,width=300,'+
'height=450,left=300,top=120';
myWindow= window.open('sample_child.html','myWindow',prefs);
</script>

</head>

<body>

<form name="myform" action="dummy" method="post">
<h1>Parent Window</h1>
Received from child:<br>
<textarea name="received" cols="20" rows="5">NOTHING RECEIVED YET</textarea>
<br>
Enter parents message here:<br>
<textarea name="message" cols="20" rows="5">NOTHING ENTERED YET</textarea><br>
<input type="button" value="SEND THE MESSAGE" onClick="myWindow.document.myform.received.value=myform.message.value">
</form>

</body>
</html>

************* sample_child.html ********************
<html>
<head>
<title>Child Window</title>
</head>

<body>

<form name="myform" action="dummy" method="post">
<h1>Child Window</h1>
Received from parent:<br>
<textarea name="received" cols="20" rows="5">NOTHING RECEIVED YET</textarea>
<br>
Enter childs message here:<br>
<textarea name="message" cols="20" rows="5">NOTHING ENTERED YET</textarea><br>
<input type="button" value="SEND THE MESSAGE" onClick="opener.document.myform.received.value=myform.message.value">
</form>

</body>
</html>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum