PDA

View Full Version : Help with contact form


jnbits
05-22-2007, 12:43 PM
Hi
I have asked this Web Design Company to design this form for my contact page on my website but i don't no how they work.
This is the html of the contact form but it dose not work when i try it my self and i don't no why it don't work and never do the web design company.
Please can someone help me. :help:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="JavaScript">
<!--

function SymError()
{
return true;
}

window.onerror = SymError;

var SymRealWinOpen = window.open;

function SymWinOpen(url, name, attributes)
{
return (new Object());
}

window.open = SymWinOpen;

//-->
</script>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- 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) {
var now = new Date();
var then = new Date(now.getTime() + 31536000000);
document.cookie = name + "=" + escape(value) + "; expires=" + then.toGMTString() + "; path=/";
}
function getInfo(form) {
form.info.value = "Browser Information: " + navigator.userAgent;
}
function getValue(element) {
var value = getCookie(element.name);
if (value != null) element.value = value;
}
function setValue(element) {
setCookie(element.name, element.value);
}
function fixElement(element, message) {
alert(message);
element.focus();
}
function isMailReady(form) {
var passed = false;
if (form.fullname.value == "") {
fixElement(form.fullname, "Please include your name.");
}
else if (form.email.value.indexOf("@") == -1 ||
form.email.value.indexOf(".") == -1) {
fixElement(form.email, "Please include a proper email address.");
}
else if (form.telephone.value == "") {
fixElement(form.telephone, "Please include a telephone number.");
}
else {
getInfo(form);
passed = true;
}
return passed;
}
// End -->

function addActionTest(theForm) {
if (theForm.subject.value != '') {

theForm.action += theForm.subject.value;
return true;

}

else { alert('Error'); return false;}
}
</SCRIPT>

</head>
<body>
<p align="center"><form name="contact form" method="post" action="mailto:sales@jnbits.co.uk" >
<p align="left" style="text-align: center">
Your Full Name:
<input type="text" size="40" name="fullname" onFocus = "getValue(this)" onBlur = "setValue(this)"/>
<br/>
Your Email Address:
<input type="text" size="40" name="email" onFocus = "getValue(this)" onBlur = "setValue(this)"/>
<br>
Telephone Number:
<input type="text" name="telephone" onFocus = "getValue(this)" onBlur = "setValue(this)">
<br>
Question Type:
<select name="subject" >
<option>Sales</option>
<option>Support</option>
<option>Newsletter</option>
</select>
</p>
</p>
<h3>Comments<br />
<textarea name="Comments" cols="36" rows="12" id="Comments"></textarea>
</h3>
<p style="text-align: center">Discount Code:
<input type="text" name="textfield">
</p>
<p style="text-align: center"><strong><font size="4">Ordering</font></strong></p>
<p style="text-align: center">Have you ordered from us before?
<input name="ordered?" type="radio" value="I have Before">
<br>
I will order from you one day
<input name="ordered?" type="radio" value="I will One Day" checked>
<br>
I wont order from you at all
<input name="ordered?" type="radio" value="I Never Will">
</p>
<p style="text-align: center"><font size="4">Feedback</font></p>
<p style="text-align: center">
<select name="select2">
<option>Excellent</option>
<option>Very Good</option>
<option>Good</option>
<option>Fair</option>
<option>Very Bad</option>
</select>
</p>
<p style="text-align: center"><br />
<br/>

<input value="Submit Form" type="submit" />
<input type="reset" name="Reset" value="Clear Form" />
</p>

</body>
</html>

<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;

function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}

function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}

SymRealOnLoad = window.onload;
window.onload = SymOnLoad;

//-->
</script>

Horus_Kol
05-22-2007, 06:58 PM
what exactly is not working - it isn't sending the email (actually, this will open the email in a mail client)...

question marks in input names are not a good idea...
also, you haven't closed your <form> element with </form>

you have a mix of xHTML and HTML style tags in there (<input> and <input />, or <br> and <br />) - there should only be one or the other...
if going xHTML - remember to have a space before the close sequence (<br />, not <br/>)

and if this form was really done by a development company, I'd ask for your money back because it is badly written and using deprecated tags to boot...

jnbits
05-23-2007, 10:01 AM
This is the page that the contact form is on so could you have a look and see if it is working coz the html before has been changed
http://www.jnbits.co.uk/Contact_Us.html