Help with Code

Help with Code

Page 1 of 1

4 Replies - 1450 Views - Last Post: 21 October 2005 - 08:36 PM

#1 danlew  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-October 05

Help with Code

Posted 18 October 2005 - 09:32 PM

I was hoping someone could test this for me to see if it works so that i recieve email. Also if i can add an image uploader that would be a great bonus!


<html>

<head><script LANGUAGE="Javascript">

<!-- Begin
function getCookie(name){
var cname = name + "=";
var dc = document.cookie;
if (dc.length > 0) {
begin = dc.indexOf(cname);
if (begin != -1) {
begin += cname.length;
end = dc.indexOf(";", begin);
if (end == -1) end = dc.length;
return unescape(dc.substring(begin, end));
}
}
return null;
}
function setCookie(name, value, expires) {
document.cookie = name + "=" + escape(value) +
((expires != null) ? "; expires=" + expires.toGMTString() : "")
+ "; path=/";
}
function setName() {
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 365));
var prompt=i = document.Mail.name.value;
setCookie("name", i, expdate);
}
function getName() {
if(getCookie("name") != null) {
document.Mail.Name.value = getCookie("emailname");
}
}
function getInfo() {
var now= new Date();
document.Mail.Info.value = "Browser: " + navigator.userAgent;
document.Mail.Info.value += "Date:" + now;
}
function checkMultiple() {
if (getCookie("emailsent") == 'true') return true;
else return false;
}
function process() {
setCookie("emailsent", "true");
with (document.Mail) {
if (Subject.selectedIndex == 1) action = "mailto:yourtalkingtome@hotmail.com?subject=TJS - Comment";
else if (Subject.selectedIndex == 2) action = "mailto:yourtalkingtome@hotmail.com?subject=TJS - Question";
else if (Subject.selectedIndex == 3) action = "mailto:yourtalkingtome@hotmail.com?subject=TJS - Suggestion";
else if (Subject.selectedIndex == 4) action = "mailto:yourtalkingtome@hotmail.com?subject=TJS - Broken Link";
else action = "mailto:yourtalkingtome@hotmail.com?subject=TJS - Other";
}
}
function formCheck() {
var passed = false;
with (document.Mail) {
if (Subject.selectedIndex == 0) {
alert("Please pick a subject.");
Subject.focus();
}
else if (Name.value == "") {
alert("Please inlcude your name.");
Name.focus();
}
else if (checkMultiple()) {
if (confirm("You just sent an e-mail from this form, are you sure you want to send another?")) {
process();
passed = true;
}
}
else {
process();
passed = true;
}
}
return passed;
}
// End -->
</script>

<title>JavaFILE</title>
<base target="leftframe">
</head>

<body BGCOLOR="#ffffff" link="#CC0033" vlink="#333399" alink="#FF0000" <!--content start-->


<table WIDTH="75%" BORDER="0" CELLSPACING="5" CELLPADDING="5">
<tr>
<font
FACE="ARIEL,HELVETICA" SIZE="-1"><p align="center"></font></a><font
FACE="ARIEL,HELVETICA" SIZE="-1"></p>
<p align="center"><font FACE="ARIEL" SIZE="4"> <a HREF="yourtalkingtome@hotmail.com?subject=TJS - Mail"></a>.
<br>
</p>
<form NAME="Mail" ACTION="mailto:yourtalkingtome@hotmail.com?subject=TJS - Form"
METHOD="POST" ENCTYPE="text/plain" onsubmit="return formCheck();">
<input type="hidden" name="Info" value><table BORDER="0" CELLPADDING="10" CELLSPACING="0">
<tr>
<td>*Business Name: <input TYPE="text" NAME="Name" onchange="setName()" size="20"> </td><td>*Phone: <input TYPE="text" NAME="Phone" onchange="setName()" size="20"> </td><td>*Email: <input TYPE="text" NAME="Email" onchange="setName()" size="20"> </td><td>*Website URL: <input TYPE="text" NAME="Website URL" onchange="setName()" size="20"> </td>
<td ALIGN="RIGHT">Subject: <select NAME="Subject" size="1">
<option SELECT>Type of Advertising Required</option>
<option>1. Basic Display Listing</option>
<option>2. Basic Listing Special 1 Year</option>
<option>3. Animated Flash Banner</option>
<option>4. Home Page Position</option>
<option>5. Category Colour Position</option>
</select> </td>
</tr>
<tr>
<td COLSPAN="2">Business Description : <br>
<br>
<textarea NAME="Comments, Suggestions" COLS="50" ROWS="6">
</textarea> </td>
</tr>
</table>
<div align="center"><center><table>
<tr>
<td align="center"><input TYPE="submit" VALUE="Send"> <script LANGUAGE="Javascript">
<!-- Begin
getInfo();
getName();
// End -->
</script></font></font></td>
</tr>
</table>
</center></div>
</form>
</td>
</tr>
</table>
<!--content stop-->
</body>
</html>

This post has been edited by danlew: 18 October 2005 - 09:34 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Help with Code

#2 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: Help with Code

Posted 18 October 2005 - 10:12 PM

If you get one from Israel Wilson, then it worked. :huh:
Was This Post Helpful? 0
  • +
  • -

#3 danlew  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-October 05

Re: Help with Code

Posted 19 October 2005 - 03:52 AM

Thankyou very much for that Israel, It works great!

Just one thing if i want to add an image uploader with a browse icon, is this possible, and what html will i need to add?
Was This Post Helpful? 0
  • +
  • -

#4 Israel  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 7
  • View blog
  • Posts: 818
  • Joined: 22-November 04

Re: Help with Code

Posted 19 October 2005 - 05:11 AM

Are you talking about on the email link? Cause when I hit "send" it brought up my default mail client, which in my case was yahoo.com with the message I had typed on your page encoded. Oh, ps-. I could read your email address this way. (You might not want to show that to the world) But I guess a user could attach whatever with their default mail client already. But if you wanted that option on your page, before their default pops up...I've never tried to do that with my site...? But I'm just about to crawl in bed. Hopefully this will get you started.

This post has been edited by Israel: 19 October 2005 - 05:11 AM

Was This Post Helpful? 0
  • +
  • -

#5 danlew  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 10-October 05

Re: Help with Code

Posted 21 October 2005 - 08:36 PM

These are the problems i am facing, can someone help me:

1.when i hit send it brings up outlook express automatically, and goes through the windows system, I dont want it to do that?

2.it also makes me visible to the world like you say how do i correct this?

3. I want clients to be able to upload there image, how do i add this option in the html?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1