
December 15th, 2003, 06:15 AM
|
|
Junior Member
|
|
Join Date: Dec 2003
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
manipulating a form
i'm trying to ad data to a form from aother (open) window. here is the code for the main page:
Code:
<script>
var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*( screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.rand om()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status= yes,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus();}
// -->
</script>
<form action="http://www.domain.com/" method="post" name="****">
<input type="text" name="ssurl" size="40" maxlength="256">
</form>
<a href="javascript:NewWindow('test.html','fileupload','600 ','450','custom','front');">Upload a file to the server</a>
and the code for the second page:
Code:
<script language="JavaScript1.2">
function seturl(url) {
window.opener.document.form.ssurl.value = url;
}
</script>
<a href="javascript:seturl('j-h-j-j-j-j-1')">jhjjjjj1</a><BR>
<a href="javascript:seturl('j-h-j-j-j-j-2')">jhjjjjj2</a><BR>
<a href="javascript:seturl('j-h-j-j-j-j-3')">jhjjjjj3</a><BR>
why doesn't this script work?
thanks for any help!
|