Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

More javascript problems :(

Options
  • 02-09-2004 11:25am
    #1
    Closed Accounts Posts: 509 ✭✭✭


    Hi!

    I am looking to find help with javascript again!
    I want when a user submits a form with registration details that those details will be sent to the email address they entered.

    This is the function and the form!

    Please help me! :o

    function initMail(form)
    {
    alert("in second function!")
    var emailaddress=form.emailad.value;
    var logName= form.logInName.value;
    var SecName= form.second.value;
    var city=form.city.value;
    alert( emailaddress)
    alert( logName)
    alert( SecName)
    alert( city)

    emailaddress+ " (" + LogName + "):\n\n"

    "\n\nYour Friend,\n" + SecName + "(" + form.city + ")";
    return (emailaddress!= "");

    }


    <form action="<cfoutput>#CurrentPage#</cfoutput>" name="form1" method="POST" onsubmit="javascript:return ValidateForm(this)&& initMail(this)">
    <table>
    <tr>
    <td colspan="2"> Login Name</td>
    <td><input type="text" value="" name="logInName"></td>
    </tr>
    <tr>
    <td colspan="2">Password</td>
    <td><input type="password" value="" name="pass"></td>
    </tr>
    <tr>
    <td colspan="2">Password</td>
    <td><input type="password" value="" name="reppass"></td>
    </tr>
    <tr>
    <td colspan="2">First Name</td>
    <td><input type="text" value="" name="first"></td>
    </tr>
    <tr>
    <td colspan="2">Last Name</td>
    <td><input type="text" value="" name="second"></td>
    </tr>
    <tr>
    <td colspan="2"> Company</td>
    <td><input type="text" value="" name="company"></td>
    </tr>
    <tr>
    <td colspan="2">Address Line 1 </td>
    <td><input type="text" value="" name="address1"></td>
    </tr>
    <tr>
    <td colspan="2">Address Line 2 </td>
    <td><input type="text" value="" name="address2"></td>
    </tr>
    <tr>
    <td colspan="2">City</td>
    <td><input type="text" value="" name="city"></td>
    </tr>
    <tr>
    <td colspan="2">Postcode</td>
    <td><input type="text" value="" name="pcode"></td>
    </tr>
    <tr>
    <td colspan="2"> Country</td>
    <td><input type="text" value="" name="country"></td>
    </tr>
    <tr>
    <td colspan="2">Phone number</td>
    <td><input type="text" value="" name="phnum"></td>
    </tr>
    <tr>
    <td colspan="2">Fax</td>
    <td><input type="text" value="" name="faxNo"></td>
    </tr>
    <tr>
    <td colspan="2">Email</td>
    <td><input type="text" value="" name="emailad"></td>
    </tr>
    <tr>
    <td><input type="submit" value="Register details"></td>
    <td><input type="reset" value="Reset" ></td>
    <td></td>
    </tr>
    </table>

    <input type="hidden" name="MM_InsertRecord" value="form1">
    </form>


Comments

  • Closed Accounts Posts: 35 Ivan Dunaev


    it is impossible to send email using javascript


  • Registered Users Posts: 2,781 ✭✭✭amen


    it is impossible to send email using javascript
    thats not strictly true
    on the client side it is impossible but
    you could use some serverside java script to send email (create relevant object and call it )


  • Registered Users Posts: 515 ✭✭✭NeverSayDie


    As pointed out by the presvious two posters, you need something on the server side to actually send the email. This can be a CGI script of some kind, Perl, PHP, ASP, etc. But one way or the other, you can't send an email directly from the client (ie the user's browser)


  • Closed Accounts Posts: 509 ✭✭✭Pinkchick03


    As pointed out by the presvious two posters, you need something on the server side to actually send the email. This can be a CGI script of some kind, Perl, PHP, ASP, etc. But one way or the other, you can't send an email directly from the client (ie the user's browser)

    Thanks NeverSayDie and everyone! I just gave up on sending email code! It isn't necessary for the site I was building - but just wanted it for a nice extra! Cheers anyway!


Advertisement