/    Sign up×
Community /Pin to ProfileBookmark

Validate form code needed

I’m struggling to get my code right in order to validate a form. I have a checkbox which when checked accepts terms and conditions, i don’t want the form to be able to be submitted without the button being checked. If i put a link to the page and include the code could someone please tell me exaclty what code i have to have and where. Thanks

[url]http://www.elitetradesmen.com/searchtrades1.html[/url]

[code]

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″/>
<title>Elite Tradesmen of Southport &amp; surrounding areas</title>
<link rel=”stylesheet” href=”style.css” type=”text/css” charset=”utf-8″ />
</head>
<body>
<div id=”wrapper”>
<h1>Elite tradesmen</h1>
<div id=”nav”>
<a href=”index.html”>Home</a>
<a href=”searchtrades1.html” class=”selected”>Submit Work</a>
<a href=”policies2.html”>Our Policies</a>
<a href=”areas1.html”>Areas</a>
<a href=”contact2.html”>Contact Us</a>
</div>
<div id=”body”>
<div id=”body-top”>
<div id=”body-top-2″></div>
<div id=”body-bot”>
<div id=”welcome”>
<img src=”images/pic_1.jpg” width=”231″ height=”301″ alt=”Pic 1″ />
<h2>Submit your job</h2>
<p>We will always post all received jobs on the website within 24 hours. If you would like someone to visit you in person to take details of the work please use the form on this page.</p>
<p>&nbsp;</p>
<p>Please read our policies page for payment terms, service agreements etc.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;<img src=”images/logo12.jpg” alt=”” width=”178″ height=”138″ /></p>
</div>
<div id=”content”>
<img src=”images/page images/submit.jpg” width=”109″ height=”109″ alt=”Pic 2″ class=”left” />
<h2>Submit your work here</h2>
<p>To request quotes from our tradesmen simply fill in the form below.</p>
<p>Your job will then be posted on our site and alerts sent to all tradesmen in the service concerned.</p>
<p>Quotes will be sent to you as and when we receive them. You will be sent portfolio information for each tradesman with every quote received.</p>
<p>When you have decided which tradesmen to use we will draw up a plan of works which will detail work to be completed, agreed amount, date to commence and complete work. This plan of works will be signed by both customer and tradesman. At this time 10&#37; of the total quote will be paid to Elite Tradesmen by the customer.</p>
<p>When the work is completed the customer will sign the plan of work to confirm that the work has been completed to your satisfaction. Once the work has been signed off payment will be made in full from the customer to the tradesman.</p>
<p>At this point we ask that you leave us some feedback in relation to the service you received both from us and your tradesman.</p>
<p>&nbsp;</p>
<p>To submit your job please complete this form:</p>
<p>&nbsp;</p>
<p>Name:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<elephone>
Telephone:<br />
<input type=”text” name=”FirstName” />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=”text” name=”LastName” />
<br />
</p>
<p>Email:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Prefered contact method:<br />
<input type=”text” name=”Tel” />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<input type=”text” name=”EmailFrom” />
<br />
</p>
<p>Address:<br />
<textarea name=”Basicjobdetails” cols=”35″ rows=”5″></textarea>
</p>
<p>Trade required:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
<input type=”text” name=”trade” id=”trade”>
&nbsp;<br />
</p>
<p>Preferred start date:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Preferred completion date:<br />
<input type=”text” name=”Tel2″ />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<input type=”text” name=”EmailFrom2″ />
<br />
</p>
<p>Details of the work you would like completed :<br />
<textarea name=”Basicjobdetails2″ cols=”35″ rows=”5″></textarea>
</p>
<div align=”justify”>
<input type=”radio” onclick=”check(this)” name=”agree”>
I agree to all the terms and conditions shown under ‘Our Policies’ </div>
<p>
<input type=”submit” name=”submit2″ value=”Submit” />
</p>
<div class=”fineline”></div>
<p>&nbsp; </p>
</div>
<div class=”clear”></div>
</div>
</div>
</div>
<div id=”footer”>
<p>Copyright &#169; 2009, Elite Tradesmen. All rights reserved</p>
</div>
</div>
</body>
</html>[/code]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@khillJun 10.2009 — There is also a helpful script that I found which can be easily setup to validate any form input field. Take a look:

http://www.jshelpbox.com/viewtopic.php?f=4&t=9
×

Success!

Help @speed1972 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...