including html input field in 'forward' url

Upload core product.
Post Reply
Mr5o1
Posts: 5
Joined: Wed Dec 16, 2009 12:30 am

including html input field in 'forward' url

Post by Mr5o1 »

Hello again!

The documentation for jfileupload explains that you can simply attach parameters to the end of your forwarding url.

but I cant work out how to attach the contents of an html form input field, located on the page containing the java applet. I've tried a few things but I'm fumbling in the dark really.

Ultimately I want the applet to forward (well.. post really but anyway) to a php script which will email the name of the file which was uploaded (easy enough) -and- the persons name, from the field i will include on the java applet page. I was planning to include the name field with a simple html form like so:

<form>
Your name:
<input type="text" name="uploader" />
</form>

obviously I have no idea what I'm doing really.. I'm just an amateur and might be in over my head. If you can just point me in the right direction or let me know even if its possible? Thanks in advance.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: including html input field in 'forward' url

Post by support »

To pass a parameter in forward:
<PARAM NAME="forward" VALUE="http://yourserver.com/script.php?yourparam=value">

I understand that yourparam=value comes from an HTML field. So you need to call the following JavaScript method to update "forward" parameter:

Code: Select all

document.fileupload.setProperty("forward","http://yourserver.com/script.php?yourparam="+yourformfied.value);
You need a an event (such as onClick on a button) to call this JavaScript function. Does it make sense ?

Mr5o1
Posts: 5
Joined: Wed Dec 16, 2009 12:30 am

Re: including html input field in 'forward' url

Post by Mr5o1 »

brilliant! thanks for your direction.. I've got it all working and ready to open this section of my site to the public..

Post Reply