Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Posting forms from Javascript

Reply
Thread Tools

Posting forms from Javascript

 
 
Jamie
Guest
Posts: n/a
 
      01-12-2004
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
URL Posting Fails in Medium Trust (3rd time posting this w/ zero replies so far) AmitKu ASP .Net 7 01-08-2007 07:31 PM
CROSS-POSTING, OR MULTI-POSTING, OR NEITHER? Colin D Digital Photography 56 03-08-2006 08:31 PM
forms authentication -- expired forms cookie vs. not provided forms cookie Eric ASP .Net Security 2 01-27-2006 10:09 PM
Top Posting vs. Bottom Posting scaredkitty Computer Support 37 04-06-2005 12:27 AM
Everytime I hover cursro over a posting, it crosses out with red mark on it.. on every posting alanb ASP .Net 2 04-23-2004 02:23 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57