Zaloguj | Zarejestruj | FAQ
Anonymous

Posting a form- to send email - using javascript

+ Odpowiedz

Posty: 5 Strona 1 z 1


Posting a form- to send email - using javascript

przez yvytty » Cz kwi 25, 2013 5:01 am

Hi, it's my first post here.
I know how to send an email using java, I just can't seem to get the write syntax for action="" and adding javascript.. I will show you code..

I've stuffed the javascript into the head- just now, so you can see what I'm trying to reference to.

Thanks in advance.

[HEAD]<link href="email.js" type="text/javascript" rel=""/>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript" src="email.js"></script>
// JavaScript Document
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
var atSign = "@"
var firstPart = "conta"
var ispP1 = "ct"
var ispP2 = "wbda"
var ispP3 = "d.com"
var wholeAddress = firstPart + ispP1 + atSign + ispP2 + ispP3
var mToPart1 = "mai"
var mToPart2 = "lto:"
var mt = mToPart1 + mToPart2
var hrefP1 = "<a href= " + mt + wholeAddress + ">Click here to email me</a>"
</SCRIPT>

[BODY] <!--??????HEEEEEEEEELP-->
<form action="email.js" method="post" name="Contact" >
<h3>First Name</h3>
<input type="text" name="FirstName" />
<h3>Last Name</h3>
<input type="text" name="LastName"/>
<h3>Email Address</h3>
<input type="email" name="EmailAddress"/>
<h3>Confirm Email Address</h3>
<input type="email" name="EmailAddress"/>
<h3>Comments</h3>
<textarea name="Comments">
</textarea>
<br />
<br />
<input type="submit" name="submit" value="Send"/>
&nbsp;&nbsp;&nbsp;
<input type="reset" name="reset" value="Reset"/>
</form>
Avatar użytkownika

yvytty


Re: Posting a form- to send email - using javascript

przez muratsal » Cz kwi 25, 2013 10:04 am

you can do it with server side coding very easily.
Avatar użytkownika

muratsal

  • Posty: 47
  • Dołączył(a): Śr paź 17, 2012 12:51 pm
--
my map applications http://haritaaraci.com/

Re: Posting a form- to send email - using javascript

przez XainPro » Cz kwi 25, 2013 6:18 pm

Use this code
document.forms["myform"].submit();
to submit a form
Avatar użytkownika

XainPro

  • Posty: 3933
  • Dołączył(a): Pt lut 17, 2012 8:10 pm

Re: Posting a form- to send email - using javascript

przez yvytty » Cz kwi 25, 2013 11:45 pm

muratsal napisał(a):you can do it with server side coding very easily.


using php?
Avatar użytkownika

yvytty


Re: Posting a form- to send email - using javascript

przez yvytty » Cz kwi 25, 2013 11:46 pm

XainPro napisał(a):Use this code
document.forms["myform"].submit();
to submit a form


Thank you, will try this.
Avatar użytkownika

yvytty



+ Odpowiedz

Strona 1 z 1