🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.javascript
4 messages
4 total messages Started by Allen Brooker Sat, 08 Sep 2001 10:11
Submitting a form with a javascript
#7
Author: Allen Brooker
Date: Sat, 08 Sep 2001 10:11
10 lines
1291 bytes
Hi all,

I need to know how to submit a form using a javascript.
Scenario:
I have a form. When the submit button is clicked I want it to call a 
javascript which checks that the necessary fields have been filled in, 
then submit the form using the 'post' method to a Perl CGI script. 

TIA
Allen
Re: Submitting a form with a javascript
#8
Author: Greg Griffiths
Date: Tue, 11 Sep 2001 19:10
17 lines
1682 bytes
You have two choices :

1. Add a document.<form name>.submit() call at the end of your validation
2. add your validation as an onsubmit component of your Form.

Allen Brooker wrote:

> Hi all,
>
> I need to know how to submit a form using a javascript.
> Scenario:
> I have a form. When the submit button is clicked I want it to call a
> javascript which checks that the necessary fields have been filled in,
> then submit the form using the 'post' method to a Perl CGI script.
>
> TIA
> Allen
Re: Submitting a form with a javascript
#9
Author: Cranston Engles
Date: Sat, 29 Sep 2001 02:11
23 lines
1459 bytes
Allen,

Feel free to check out the code on my contact page:

http://www.rawconfusion.com/contact.htm

It will submit the form purely through javascript.

I hope that helps
On Sat, 8 Sep 2001 11:11:22 +0100, Allen Brooker
<allen@brooker.gb.net> wrote:

>Hi all,
>
>I need to know how to submit a form using a javascript.
>Scenario:
>I have a form. When the submit button is clicked I want it to call a 
>javascript which checks that the necessary fields have been filled in, 
>then submit the form using the 'post' method to a Perl CGI script. 
>
>TIA
>Allen
>
Re: Submitting a form with a javascript
#10
Author: Hywel Jenkins
Date: Sat, 29 Sep 2001 10:06
41 lines
2499 bytes
In article <3bb52d85.2430945@news.mindspring.com>, never@ever.net 
says...
> Allen,
> 
> Feel free to check out the code on my contact page:
> 
> http://www.rawconfusion.com/contact.htm
> 
> It will submit the form purely through javascript.
> 
> I hope that helps
It doesn't work:
<form name="Mail" action="mailto:design@rawconfusion.com?
subject=RawConfusion Comments"

For starters, mailto: as a form action is unreliable - you'll never know 
whether the mail client even tried to send the message, whether it 
killed the user's browser or machine, or one of a variety of other 
problems.

Secondly, you've added the subject to the mailto URL.  That's bad - it's 
a malformed URL, and can result in lost mail, mail client freezing, etc.

Thirdly, you've mixed a GET querystring with a POST method.

Read this:
http://allmyfaqs.com/cgi-bin/wiki.pl?Top-posting_or_bottom-posting

> On Sat, 8 Sep 2001 11:11:22 +0100, Allen Brooker
> <allen@brooker.gb.net> wrote:
> >I need to know how to submit a form using a javascript.
> >Scenario:
> >I have a form. When the submit button is clicked I want it to call a 
> >javascript which checks that the necessary fields have been filled in, 
> >then submit the form using the 'post' method to a Perl CGI script. 

-- 
Hywel      I do not eat quiche
Web Site   http://hyweljenkins.com/
WIP        http://hyweljenkins.co.uk/
MicroFAQ   http://hyweljenkins.co.uk/mfaq.php
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads