Page 1 of 1

Manipulating a form

Posted: Mon Aug 16, 2004 12:55 pm
by ner0
[b]Ok, heres the deal....
I have a form, which will be used to upload files to a server. I have my input box for the link to the uploaded file...
and I have a javascript popup window which is the actual uploader. once the uploading process is finished (this all works until this point) I have a links, which will be used to input the link to the input box on the form (in the parent window)... enough blabbering, heres my code:

[/b][u]Parent window (main form):[/u]
[code]<script LANGUAGE="javascript">
<!--

function win1() {
   window.open("uploader.php","UPLOADER","menubar=no,scrollbars=yes,width=400,height=300,toolbar=no");
}

//-->

<form name="upload1" action="uploader2.php" method="POST">
   <a href="javascript:win1()" onmouseover="self.status=\'Open the Uploader.\'; return true;"><b>Click here to upload a file to the server.</b></a><br><br>
  Link to uploaded file <input type="text" name="link">
</form>[/code]

all this form works fine, and the uploader opens no problem...

now heres the code for the final page of the uploader:

[code]<script language="javascript">
function seturl(url) {
 opener.document.form.fontlink.value = url;
}
</script>

$seturl = "javascript:seturl(\'" . $thelink . "\')";
echo "<a href=\"$seturl\">Click Here to place this URL in the Download URL field.</a><br>";[/code]
[b]
obviously theres more code in these, ie. to define the variabled etc. but I know all of that is working, its the java which is my problem, can anyone help this java n00b? /blum.gif\' class=\'bbc_emoticon\' alt=\':P\' />


[/b]

Manipulating a form

Posted: Mon Aug 16, 2004 8:12 pm
by Scott
[code]<script language="javascript">
function seturl(url) {
 window.opener.document.<formname>.fontlink.value = url;
}
</script>[/code]

Should work, I think...

Manipulating a form

Posted: Tue Aug 17, 2004 10:02 am
by ner0
[b]Works a charm /smile.gif\' class=\'bbc_emoticon\' alt=\':)\' /> ty buzzard /blum.gif\' class=\'bbc_emoticon\' alt=\':P\' />[/b]