Posting forms from Javascript

J

Jamie

Is it possible to submit a form, from Javascript using the post
method? From what I've read it is possible. And for some reason, when
I submit the form from Javascript it insists on using the get method.
Here's the HTML:

<form ENCTYPE="multipart/form-data" NAME="upload_form" METHOD=POST
ACTION="processor?put+58">
<input type="file" name="userfile" size="30">
<input type="button" OnClick="Upload()" NAME="op-upload" value="Upload
File">
</form>

Now the Javascript is simply:

function Upload() {
document.upload_form.submit();
}

and I used to have an alert in there annunciate upload_form.method,
which is post. For some reason my cgi always receives this as get. So
far I've been able to test it in Mozilla 5 for Linux, and IE6 for XP.

Now, if I replace the above submit button, w/a real submit button,
like this:

<input type="submit" NAME="op-upload" value="Upload File">

thereby elimanating the use of Javascript altogether, it sends as
post, like it should.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top