Solved

forms in html page

Posted on 1997-10-14
3
217 Views
Last Modified: 2006-11-17
Hello
How can I do a form with several fields wich after the user fullfiled them are sent to me by e-mail?
Thanks

0
Comment
Question by:asimoes
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
qed070297 earned 10 total points
ID: 1840424
"Mail" is a program external to the browser.  So, using
JavaScript or HTML by itself is impossible.

Through CGI, you can cause your public account to mail back to
some known account fairly easily via some temporary file
manipulation and shell commands.  The specifics are a matter of
learning CGI and having a reasonable grasp of C or Perl.

Alternatively, if your clients are running internet explorer
there are probably ways to do this with activeX.  Or more
generally, with Java Beans.
0
 

Author Comment

by:asimoes
ID: 1840425
Hello again.
Well, I thought that I need to learn CGI but this example that I'm showing to you makes the user field the form and after it will send the result to my mail.
Is this CGI code in an html page? And can I do this?
____________________________________________________-
<HTML>
<TITLE>Email form using OnChange and OnClick commands</TITLE>
<HEAD>

<script language="JavaScript">

var browsername = navigator.appName + " " + navigator.appVersion;
var getkey = browsername.substring(0, 12);

var next ="final.html";

var formfilled1 = "";
var formfilled2 = "";
var formfilled3 = "";
var formfilled4 = "";
var formfilled5 = "";
var formfilled6 = "";
var formfilled7 = "";
var formfilled8 = "";
var formfilled9 = "";


function senddata()
{
 if ((browsername.substring(0, 8)=="Netscape") &&  ((getkey=="Netscape 3.0") || (getkey=="Netscape 2.0")))
 {
 timerID=setTimeout('nextpage()',5000)
 return true;
 }
 if (browsername.substring(0, 9)=="Microsoft")
 {
 nextpage();
 return false;
 }
}

function nextpage()
{
 window.location=next;
}

function form1()
{}
function form2()
{}
function form3()
{}
function form4()
{}
function form5()
{}
function form6()
{}
function form7()
{}
function form8()
{}
function form9()

{}
</script>
</HEAD>


<BODY BGCOLOR="#00FFFF" TEXT="#000000" LINK="#00FF00" VLINK="#80FFFF" ALINK="#FF0000">


<FORM ENCTYPE='text/plain' NAME='mail' action='mailto:anecra@mail.telepac.pt'
 METHOD='GET' onSubmit='return senddata()'>

<center>
<B>INTRODUZA OS SEGUINTES DADOS:</b><P>
</center>

<TABLE WITDH="100%" BORDER=1>
<TR>
<TD width="150">

Nome da Empresa:<p>
Contacto:<br>
Morada:<br>
Codigo Postal:<br>
Localidade:<br>
Distrito:<br>
Telefone:<br>
Idade:<br>
Profissão:<br>
</TD>


<TD width="50%">
<INPUT NAME="nome" TYPE="text" width=15 OnChange="form1()"><br>
<INPUT NAME="contacto" TYPE="text" width=15 OnChange="form2()"><br>
<INPUT NAME="morada" TYPE="text" width=15 OnChange="form3()"><br>
<INPUT NAME="postal" TYPE="text" width=15 OnChange="form4()"><br>
<INPUT NAME="local" TYPE="text" width=15 OnChange="form5()"><br>
<INPUT NAME="distrito" TYPE="text" width=15 OnChange="form6()"><br>
<INPUT NAME="telefone" TYPE="text" width=15 OnChange="form7()"><br>
<INPUT NAME="idade" TYPE="text" width=15 OnChange="form8()"><br>
<INPUT NAME="profissao" TYPE="text" width=15 OnChange="form9()"><br>


</TD>
</TR>

</TABLE>
<P>

<BR>
<INPUT NAME="submitter" value="Enviar" TYPE=submit value="" OnClick="nextpage()">
<INPUT NAME="reset" value="Limpar" TYPE=reset value="" OnClick="nextpage()">


</form>
_________________________________________________
thanks

0
 
LVL 1

Expert Comment

by:qed070297
ID: 1840426
Psyche!  No, this is not using CGI.  This is a very scary piece
of HTML that tells me that Netscape (or perhaps this is a standard I was not aware of) has some extensions for bringing
CGI-like capability straight into HTML.  Notably the following
line:

  <FORM ENCTYPE='text/plain' NAME='mail'   action='mailto:anecra@mail.telepac.pt'
  METHOD='GET' onSubmit='return senddata()'>

is where the scary work is being done; referring to the "GET"
CGI communication mechanism.  Obviously it only works with
Netscape as is made obvious from your test near the beginning.

Well anyhow, good work in discovering this for yourself and for
presenting it here; I've learned something new.  BTW, where did
you pick this up?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question