Manipulating a form

Get Help With All Aspects of Web Design & Design Software

Moderators: Moderator, Global Moderator

Post Reply
ner0
Hero Member
Hero Member
Posts: 982
Joined: Sat May 22, 2004 4:45 pm

Manipulating a form

Post by ner0 »

<font face=\"verdana\" color=\"#603621\">[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? <img src=\'http://www.killanet.net/forum3/public/s ... >/blum.gif\' class=\'bbc_emoticon\' alt=\':P\' />


[/b]</font>
Last edited by ner0 on Mon Aug 16, 2004 1:13 pm, edited 1 time in total.
[color=\"green\"]'class KPIM::ProcessManager' only defines private constructors and has no friends[/color] <- :( poor class



[18:09:00] * ~Moppy stews ner0 erotically 1 times.
Scott
Administrator
Administrator
Posts: 1651
Joined: Sun Apr 25, 2004 1:08 pm

Manipulating a form

Post by Scott »

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

Should work, I think...
ner0
Hero Member
Hero Member
Posts: 982
Joined: Sat May 22, 2004 4:45 pm

Manipulating a form

Post by ner0 »

<font face=\"verdana\" color=\"#603621\">[b]Works a charm <img src=\'http://www.killanet.net/forum3/public/s ... /smile.gif\' class=\'bbc_emoticon\' alt=\':)\' /> ty buzzard <img src=\'http://www.killanet.net/forum3/public/s ... >/blum.gif\' class=\'bbc_emoticon\' alt=\':P\' />[/b]</font>
[color=\"green\"]'class KPIM::ProcessManager' only defines private constructors and has no friends[/color] <- :( poor class



[18:09:00] * ~Moppy stews ner0 erotically 1 times.
Post Reply

Return to “Web Design Principles”