Solved

forms in html page

Posted on 1997-10-14
3
195 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

760 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now