Monk3h
12-16-2010, 03:19 PM
I am having trouble submitting a form after validation.
Here is my script.
The validation works fine its just that after the form does not submit.
<script language='javascript'>
function verifyMe(){
var msg='';
if(document.getElementById('company').value==''){
msg+='- Company Name\n\n';}
if(document.getElementById('contact').value==''){
msg+='- Contact Name / Job Title\n\n';}
if(document.getElementById('address').value==''){
msg+='- Trading Address\n\n';}
if(document.getElementById('postcode').value==''){
msg+='- Postcode\n\n';}
if(document.getElementById('telephone').value==''){
msg+='- Telephone\n\n';}
if(document.getElementById('mobile').value==''){
msg+='- Mobile\n\n';}
var email=document.getElementById('email').value;
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))){
msg+='- Invalid Email Address: '+email+'\n\n';}
if(document.getElementById('email').value==''){
msg+='- Email\n\n';}
if(document.getElementById('employees').value==''){
msg+='- Number of Full-Time equivalent employees\n\n';}
if(document.getElementById('turnover').value==''){
msg+='- Annual Turnover\n\n';}
if(document.getElementById('assetvalue').value==''){
msg+='- Total asset value\n\n';}
if(!document.getElementById('sme[0]').checked && !document.getElementById('sme[1]').checked){
msg+='- Is more than 25% of your company owned by an enterprise which is not itself an SME?\n\n';}
if(document.getElementById('tradetime').value==''){
msg+='- How many months has your company been trading?\n\n';}
if(document.getElementById('nature').value==''){
msg+='- Nature of Business Sector\n\n';}
if(document.getElementById('typeofo').value==''){
msg+='- Type of Organisation\n\n';}
if(document.getElementById('companyregisteredname').value==''){
msg+='- Company Registered Name\n\n';}
if(document.getElementById('regnumber').value==''){
msg+='- Registration Number\n\n';}
if(document.getElementById('vatreg').value==''){
msg+='- VAT Reg Number\n\n';}
if(document.getElementById('regaddress').value==''){
msg+='- Registered Address\n\n';}
if(document.getElementById('catapply').value==''){
msg+='- Which Catagories Apply?\n\n';}
if(document.getElementById('fuelused').value==''){
msg+='- Current fuel used\n\n';}
if(document.getElementById('otherfuel').value==''){
msg+='- Other (if applicable)\n\n';}
if(document.getElementById('heatingpercent').value==''){
msg+='- What percentage of this is used for heating?\n\n';}
if(document.getElementById('factoryspaceheating').value==''){
msg+='- Factory Space Heating\n\n';}
if(document.getElementById('officeheating').value==''){
msg+='- Office Heating\n\n';}
if(document.getElementById('hotwater').value==''){
msg+='- Hot Water\n\n';}
if(document.getElementById('heaterrating').value==''){
msg+='- Combine Rating of Existing Heaters\n\n';}
if(document.getElementById('existingheaters').value==''){
msg+='- Number of existing heaters\n\n';}
if(document.getElementById('setbackheating').value==''){
msg+='- Is night set back heating employed?\n\n';}
if(document.getElementById('billavalable').value==''){
msg+='- Are they avalable?\n\n';}
if(document.getElementById('factorysize').value==''){
msg+='- Factory Size\n\n';}
if(document.getElementById('roofheighte').value==''){
msg+='- Roof Height to Eaves\n\n';}
if(document.getElementById('roofheightr').value==''){
msg+='- Roof Height to Ridge\n\n';}
if(document.getElementById('builddate').value==''){
msg+='- Approx. Date building was built\n\n';}
if(document.getElementById('spraybooths').value==''){
msg+='- Spray Booths?\n\n';}
if(document.getElementById('dustextract').value==''){
msg+='- Dust Extraction\n\n';}
if(document.getElementById('air').value==''){
msg+='- Is the air returned to the building?\n\n';}
if(document.getElementById('rollershutters').value==''){
msg+='- Roller Shutters?\n\n';}
if(document.getElementById('weekoc').value==''){
msg+='- Weekly building occupancy\n\n';}
if(document.getElementById('occupancy').value==''){
msg+='- Daily Building Occupancy\n\n';}
if(document.getElementById('woodwaste').value==''){
msg+='- Type of wood waste\n\n';}
if(document.getElementById('woodavailable').value==''){
msg+='- Quantity available per wek\n\n';}
if(document.getElementById('upload').value==''){
msg+='- Upload bills here.\n\n';}
if(msg!=''){
alert('The following fields are empty or invalid:\n\n'+msg);
return false
}else{
document.carbonform.submit();
return true }
}
</script>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="stylized" class="myform">
<form name='carbonform' action="process.php" method='POST' enctype='application/x-www-form-urlencoded' onsubmit='return verifyMe();'>
<table class='table_form_1' id='table_form_1' cellspacing='0'>
<h1>Carbon Trust Application Form.</h1>
<p>Please make sure you enter all fields marked with an <b style='color:red'>*</b>. If you submit an incomplete form we cannot help you.</p>
<tr>
<td class='ftbl_row_1' ><LABEL for='company' ACCESSKEY='none' ><b style='color:red'>*</b>Company Name
</td>
<td class='ftbl_row_1a' ><input type='text' name='company' id='company' size='45' maxlength='150' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='contact' ACCESSKEY='none' ><b style='color:red'>*</b>Contact Name / Job Title
</td>
<td class='ftbl_row_2a' ><input type='text' name='contact' id='contact' size='45' maxlength='150' value=''>
</td>
</tr>
<tr>
<td valign='top' class='ftbl_row_1' ><LABEL for='address' ACCESSKEY='none' ><b style='color:red'>*</b>Trading Address
</td>
<td class='ftbl_row_1a' ><textarea name='address' id='address' cols='35' rows='6' value=''></textarea>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='postcode' ACCESSKEY='none' ><b style='color:red'>*</b>Postcode
</td>
<td class='ftbl_row_2a' ><input type='text' name='postcode' id='postcode' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='telephone' ACCESSKEY='none' ><b style='color:red'>*</b>Telephone
</td>
<td class='ftbl_row_1a' ><input type='text' name='telephone' id='telephone' size='45' maxlength='30' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='mobile' ACCESSKEY='none' ><b style='color:red'>*</b>Mobile
</td>
<td class='ftbl_row_2a' ><input type='text' name='mobile' id='mobile' size='45' maxlength='20' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='email' ACCESSKEY='none' ><b style='color:red'>*</b>Email
</td>
<td class='ftbl_row_1a' ><input type='text' name='email' id='email' size='45' maxlength='50' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='employees' ACCESSKEY='none' ><b style='color:red'>*</b>Number of Full-Time equivalent employees
</td>
<td class='ftbl_row_2a' ><input type='text' name='employees' id='employees' size='45' maxlength='8' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='turnover' ACCESSKEY='none' ><b style='color:red'>*</b>Annual Turnover
</td>
<td class='ftbl_row_1a' ><input type='text' name='turnover' id='turnover' size='45' maxlength='20' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='assetvalue' ACCESSKEY='none' ><b style='color:red'>*</b>Total asset value
</td>
<td class='ftbl_row_2a' ><input type='text' name='assetvalue' id='assetvalue' size='45' maxlength='20' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><b style='color:red'>*</b>Is more than 25% of your company owned by an enterprise which is not itself an SME?
</td>
<td class='ftbl_row_1a' >
<LABEL ACCESSKEY='1'><input type='checkbox' name='sme' id='sme[0]' value='Yes'>Yes</LABEL>
<LABEL ACCESSKEY='2'><input type='checkbox' name='sme' id='sme[1]' value='No' CHECKED >No</LABEL>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='tradetime' ACCESSKEY='none' ><b style='color:red'>*</b>How many months has your company been trading?
</td>
<td class='ftbl_row_2a' ><input type='text' name='tradetime' id='tradetime' size='45' maxlength='5' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='nature' ACCESSKEY='none' ><b style='color:red'>*</b>Nature of Business Sector
</td>
<td class='ftbl_row_1a' ><input type='text' name='nature' id='nature' size='45' maxlength='50' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='typeofo' ACCESSKEY='none' ><b style='color:red'>*</b>Type of Organisation
</td>
<td class='ftbl_row_2a' ><select name='typeofo' id='typeofo'>
<option value='Public'>Public</option>
<option value='Private'>Private</option>
<option value='Charity'>Charity</option>
<option value='Limited / Sole Trader'>Limited / Sole Trader</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='companyregisteredname' ACCESSKEY='none' ><b style='color:red'>*</b>Company Registered Name
</td>
<td class='ftbl_row_1a' ><input type='text' name='companyregisteredname' id='companyregisteredname' size='45' maxlength='150' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='regnumber' ACCESSKEY='none' ><b style='color:red'>*</b>Registration Number
</td>
<td class='ftbl_row_2a' ><input type='text' name='regnumber' id='regnumber' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='vatreg' ACCESSKEY='none' ><b style='color:red'>*</b>VAT Reg Number
</td>
<td class='ftbl_row_1a' ><input type='text' name='vatreg' id='vatreg' size='45' maxlength='15' value=''>
</td>
</tr>
<tr>
<td valign='top' class='ftbl_row_2' ><LABEL for='regaddress' ACCESSKEY='none' ><b style='color:red'>*</b>Registered Address
</td>
<td class='ftbl_row_2a' ><textarea name='regaddress' id='regaddress' cols='35' rows='6' value=''></textarea>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='catapply' ACCESSKEY='none' ><b style='color:red'>*</b>Which Catagories Apply?
</td>
<td class='ftbl_row_1a' ><select name='catapply' id='catapply'>
<option value='Space Heating'>Space Heating</option>
<option value=' Process Heating'> Process Heating</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='fuelused' ACCESSKEY='none' ><b style='color:red'>*</b>Current fuel used
</td>
<td class='ftbl_row_2a' ><select name='fuelused' id='fuelused'>
<option value='Gas'>Gas</option>
<option value='Oil'>Oil</option>
<option value='Other'>Other</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='otherfuel' ACCESSKEY='none' ><b style='color:red'>*</b>Other (if applicable)
</td>
<td class='ftbl_row_1a' ><input type='text' name='otherfuel' id='otherfuel' size='45' maxlength='30' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='heatingpercent' ACCESSKEY='none' ><b style='color:red'>*</b>What percentage of this is used for heating?
</td>
<td class='ftbl_row_2a' ><input type='text' name='heatingpercent' id='heatingpercent' size='45' maxlength='3' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='factoryspaceheating' ACCESSKEY='none' ><b style='color:red'>*</b>Factory Space Heating
</td>
<td class='ftbl_row_1a' ><input type='text' name='factoryspaceheating' id='factoryspaceheating' size='45' maxlength='100' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='officeheating' ACCESSKEY='none' ><b style='color:red'>*</b>Office Heating
</td>
<td class='ftbl_row_2a' ><input type='text' name='officeheating' id='officeheating' size='45' maxlength='3' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='hotwater' ACCESSKEY='none' ><b style='color:red'>*</b>Hot Water
</td>
<td class='ftbl_row_1a' ><input type='text' name='hotwater' id='hotwater' size='45' maxlength='3' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='heaterrating' ACCESSKEY='none' ><b style='color:red'>*</b>Combine Rating of Existing Heaters
</td>
<td class='ftbl_row_2a' ><input type='text' name='heaterrating' id='heaterrating' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='existingheaters' ACCESSKEY='none' ><b style='color:red'>*</b>Number of existing heaters
</td>
<td class='ftbl_row_1a' ><input type='text' name='existingheaters' id='existingheaters' size='45' maxlength='4' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='setbackheating' ACCESSKEY='none' ><b style='color:red'>*</b>Is night set back heating employed?
</td>
<td class='ftbl_row_2a' ><select name='setbackheating' id='setbackheating'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='billavalable' ACCESSKEY='none' ><b style='color:red'>*</b>Are they avalable?
</td>
<td class='ftbl_row_1a' ><select name='billavalable' id='billavalable'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='factorysize' ACCESSKEY='none' ><b style='color:red'>*</b>Factory Size
</td>
<td class='ftbl_row_2a' ><input type='text' name='factorysize' id='factorysize' size='45' maxlength='60' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='roofheighte' ACCESSKEY='none' ><b style='color:red'>*</b>Roof Height to Eaves
</td>
<td class='ftbl_row_1a' ><input type='text' name='roofheighte' id='roofheighte' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='roofheightr' ACCESSKEY='none' ><b style='color:red'>*</b>Roof Height to Ridge
</td>
<td class='ftbl_row_2a' ><input type='text' name='roofheightr' id='roofheightr' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='builddate' ACCESSKEY='none' ><b style='color:red'>*</b>Approx. Date building was built
</td>
<td class='ftbl_row_1a' ><input type='text' name='builddate' id='builddate' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='spraybooths' ACCESSKEY='none' ><b style='color:red'>*</b>Spray Booths?
</td>
<td class='ftbl_row_2a' ><select name='spraybooths' id='spraybooths'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='dustextract' ACCESSKEY='none' ><b style='color:red'>*</b>Dust Extraction
</td>
<td class='ftbl_row_1a' ><select name='dustextract' id='dustextract'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='air' ACCESSKEY='none' ><b style='color:red'>*</b>Is the air returned to the building?
</td>
<td class='ftbl_row_2a' ><select name='air' id='air'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='rollershutters' ACCESSKEY='none' ><b style='color:red'>*</b>Roller Shutters?
</td>
<td class='ftbl_row_1a' ><select name='rollershutters' id='rollershutters'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='weekoc' ACCESSKEY='none' ><b style='color:red'>*</b>Weekly building occupancy
</td>
<td class='ftbl_row_2a' ><input type='text' name='weekoc' id='weekoc' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='occupancy' ACCESSKEY='none' ><b style='color:red'>*</b>Daily Building Occupancy
</td>
<td class='ftbl_row_1a' ><input type='text' name='occupancy' id='occupancy' size='45' maxlength='5' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='woodwaste' ACCESSKEY='none' ><b style='color:red'>*</b>Type of wood waste
</td>
<td class='ftbl_row_2a' ><input type='text' name='woodwaste' id='woodwaste' size='45' maxlength='30' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='woodavailable' ACCESSKEY='none' ><b style='color:red'>*</b>Quantity available per wek
</td>
<td class='ftbl_row_1a' ><input type='text' name='woodavailable' id='woodavailable' size='45' maxlength='20' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='upload' ACCESSKEY='none' ><b style='color:red'>*</b>Upload bills here.
</td>
<td class='ftbl_row_2a' ><input type='file' name='upload' id='upload' size='100' value=''>
</td>
</tr>
<tr>
<td colspan='2' align='right'><input type='submit' name='submit' value='Submit' onclick="function verifyMe()" > <input type='reset' name='reset' value='Reset'><br /><a href='http://www.Jaynetdesign.com.com' style='font-family:arial;font-size:10px;color:#C0C0C0;text-decoration:none'>Created by James Eley</a>
</td>
</tr>
</table>
</form>
</div>
</body>
</HTML>
Key info is on lines: 138 - 152
if(msg!=''){
alert('The following fields are empty or invalid:\n\n'+msg);
return false
}else{
document.carbonform.submit();
return true }
}
<form name='carbonform' action="process.php" method='POST' enctype='application/x-www-form-urlencoded' onsubmit='return verifyMe();'>
and 441.
<td colspan='2' align='right'><input type='submit' name='submit' value='Submit' onclick="function verifyMe()" > <input type='reset' name='reset' value='Reset'>
My php script just contains an echo to test.
Thanks in advance.
Here is my script.
The validation works fine its just that after the form does not submit.
<script language='javascript'>
function verifyMe(){
var msg='';
if(document.getElementById('company').value==''){
msg+='- Company Name\n\n';}
if(document.getElementById('contact').value==''){
msg+='- Contact Name / Job Title\n\n';}
if(document.getElementById('address').value==''){
msg+='- Trading Address\n\n';}
if(document.getElementById('postcode').value==''){
msg+='- Postcode\n\n';}
if(document.getElementById('telephone').value==''){
msg+='- Telephone\n\n';}
if(document.getElementById('mobile').value==''){
msg+='- Mobile\n\n';}
var email=document.getElementById('email').value;
if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email))){
msg+='- Invalid Email Address: '+email+'\n\n';}
if(document.getElementById('email').value==''){
msg+='- Email\n\n';}
if(document.getElementById('employees').value==''){
msg+='- Number of Full-Time equivalent employees\n\n';}
if(document.getElementById('turnover').value==''){
msg+='- Annual Turnover\n\n';}
if(document.getElementById('assetvalue').value==''){
msg+='- Total asset value\n\n';}
if(!document.getElementById('sme[0]').checked && !document.getElementById('sme[1]').checked){
msg+='- Is more than 25% of your company owned by an enterprise which is not itself an SME?\n\n';}
if(document.getElementById('tradetime').value==''){
msg+='- How many months has your company been trading?\n\n';}
if(document.getElementById('nature').value==''){
msg+='- Nature of Business Sector\n\n';}
if(document.getElementById('typeofo').value==''){
msg+='- Type of Organisation\n\n';}
if(document.getElementById('companyregisteredname').value==''){
msg+='- Company Registered Name\n\n';}
if(document.getElementById('regnumber').value==''){
msg+='- Registration Number\n\n';}
if(document.getElementById('vatreg').value==''){
msg+='- VAT Reg Number\n\n';}
if(document.getElementById('regaddress').value==''){
msg+='- Registered Address\n\n';}
if(document.getElementById('catapply').value==''){
msg+='- Which Catagories Apply?\n\n';}
if(document.getElementById('fuelused').value==''){
msg+='- Current fuel used\n\n';}
if(document.getElementById('otherfuel').value==''){
msg+='- Other (if applicable)\n\n';}
if(document.getElementById('heatingpercent').value==''){
msg+='- What percentage of this is used for heating?\n\n';}
if(document.getElementById('factoryspaceheating').value==''){
msg+='- Factory Space Heating\n\n';}
if(document.getElementById('officeheating').value==''){
msg+='- Office Heating\n\n';}
if(document.getElementById('hotwater').value==''){
msg+='- Hot Water\n\n';}
if(document.getElementById('heaterrating').value==''){
msg+='- Combine Rating of Existing Heaters\n\n';}
if(document.getElementById('existingheaters').value==''){
msg+='- Number of existing heaters\n\n';}
if(document.getElementById('setbackheating').value==''){
msg+='- Is night set back heating employed?\n\n';}
if(document.getElementById('billavalable').value==''){
msg+='- Are they avalable?\n\n';}
if(document.getElementById('factorysize').value==''){
msg+='- Factory Size\n\n';}
if(document.getElementById('roofheighte').value==''){
msg+='- Roof Height to Eaves\n\n';}
if(document.getElementById('roofheightr').value==''){
msg+='- Roof Height to Ridge\n\n';}
if(document.getElementById('builddate').value==''){
msg+='- Approx. Date building was built\n\n';}
if(document.getElementById('spraybooths').value==''){
msg+='- Spray Booths?\n\n';}
if(document.getElementById('dustextract').value==''){
msg+='- Dust Extraction\n\n';}
if(document.getElementById('air').value==''){
msg+='- Is the air returned to the building?\n\n';}
if(document.getElementById('rollershutters').value==''){
msg+='- Roller Shutters?\n\n';}
if(document.getElementById('weekoc').value==''){
msg+='- Weekly building occupancy\n\n';}
if(document.getElementById('occupancy').value==''){
msg+='- Daily Building Occupancy\n\n';}
if(document.getElementById('woodwaste').value==''){
msg+='- Type of wood waste\n\n';}
if(document.getElementById('woodavailable').value==''){
msg+='- Quantity available per wek\n\n';}
if(document.getElementById('upload').value==''){
msg+='- Upload bills here.\n\n';}
if(msg!=''){
alert('The following fields are empty or invalid:\n\n'+msg);
return false
}else{
document.carbonform.submit();
return true }
}
</script>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="stylized" class="myform">
<form name='carbonform' action="process.php" method='POST' enctype='application/x-www-form-urlencoded' onsubmit='return verifyMe();'>
<table class='table_form_1' id='table_form_1' cellspacing='0'>
<h1>Carbon Trust Application Form.</h1>
<p>Please make sure you enter all fields marked with an <b style='color:red'>*</b>. If you submit an incomplete form we cannot help you.</p>
<tr>
<td class='ftbl_row_1' ><LABEL for='company' ACCESSKEY='none' ><b style='color:red'>*</b>Company Name
</td>
<td class='ftbl_row_1a' ><input type='text' name='company' id='company' size='45' maxlength='150' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='contact' ACCESSKEY='none' ><b style='color:red'>*</b>Contact Name / Job Title
</td>
<td class='ftbl_row_2a' ><input type='text' name='contact' id='contact' size='45' maxlength='150' value=''>
</td>
</tr>
<tr>
<td valign='top' class='ftbl_row_1' ><LABEL for='address' ACCESSKEY='none' ><b style='color:red'>*</b>Trading Address
</td>
<td class='ftbl_row_1a' ><textarea name='address' id='address' cols='35' rows='6' value=''></textarea>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='postcode' ACCESSKEY='none' ><b style='color:red'>*</b>Postcode
</td>
<td class='ftbl_row_2a' ><input type='text' name='postcode' id='postcode' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='telephone' ACCESSKEY='none' ><b style='color:red'>*</b>Telephone
</td>
<td class='ftbl_row_1a' ><input type='text' name='telephone' id='telephone' size='45' maxlength='30' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='mobile' ACCESSKEY='none' ><b style='color:red'>*</b>Mobile
</td>
<td class='ftbl_row_2a' ><input type='text' name='mobile' id='mobile' size='45' maxlength='20' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='email' ACCESSKEY='none' ><b style='color:red'>*</b>Email
</td>
<td class='ftbl_row_1a' ><input type='text' name='email' id='email' size='45' maxlength='50' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='employees' ACCESSKEY='none' ><b style='color:red'>*</b>Number of Full-Time equivalent employees
</td>
<td class='ftbl_row_2a' ><input type='text' name='employees' id='employees' size='45' maxlength='8' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='turnover' ACCESSKEY='none' ><b style='color:red'>*</b>Annual Turnover
</td>
<td class='ftbl_row_1a' ><input type='text' name='turnover' id='turnover' size='45' maxlength='20' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='assetvalue' ACCESSKEY='none' ><b style='color:red'>*</b>Total asset value
</td>
<td class='ftbl_row_2a' ><input type='text' name='assetvalue' id='assetvalue' size='45' maxlength='20' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><b style='color:red'>*</b>Is more than 25% of your company owned by an enterprise which is not itself an SME?
</td>
<td class='ftbl_row_1a' >
<LABEL ACCESSKEY='1'><input type='checkbox' name='sme' id='sme[0]' value='Yes'>Yes</LABEL>
<LABEL ACCESSKEY='2'><input type='checkbox' name='sme' id='sme[1]' value='No' CHECKED >No</LABEL>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='tradetime' ACCESSKEY='none' ><b style='color:red'>*</b>How many months has your company been trading?
</td>
<td class='ftbl_row_2a' ><input type='text' name='tradetime' id='tradetime' size='45' maxlength='5' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='nature' ACCESSKEY='none' ><b style='color:red'>*</b>Nature of Business Sector
</td>
<td class='ftbl_row_1a' ><input type='text' name='nature' id='nature' size='45' maxlength='50' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='typeofo' ACCESSKEY='none' ><b style='color:red'>*</b>Type of Organisation
</td>
<td class='ftbl_row_2a' ><select name='typeofo' id='typeofo'>
<option value='Public'>Public</option>
<option value='Private'>Private</option>
<option value='Charity'>Charity</option>
<option value='Limited / Sole Trader'>Limited / Sole Trader</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='companyregisteredname' ACCESSKEY='none' ><b style='color:red'>*</b>Company Registered Name
</td>
<td class='ftbl_row_1a' ><input type='text' name='companyregisteredname' id='companyregisteredname' size='45' maxlength='150' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='regnumber' ACCESSKEY='none' ><b style='color:red'>*</b>Registration Number
</td>
<td class='ftbl_row_2a' ><input type='text' name='regnumber' id='regnumber' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='vatreg' ACCESSKEY='none' ><b style='color:red'>*</b>VAT Reg Number
</td>
<td class='ftbl_row_1a' ><input type='text' name='vatreg' id='vatreg' size='45' maxlength='15' value=''>
</td>
</tr>
<tr>
<td valign='top' class='ftbl_row_2' ><LABEL for='regaddress' ACCESSKEY='none' ><b style='color:red'>*</b>Registered Address
</td>
<td class='ftbl_row_2a' ><textarea name='regaddress' id='regaddress' cols='35' rows='6' value=''></textarea>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='catapply' ACCESSKEY='none' ><b style='color:red'>*</b>Which Catagories Apply?
</td>
<td class='ftbl_row_1a' ><select name='catapply' id='catapply'>
<option value='Space Heating'>Space Heating</option>
<option value=' Process Heating'> Process Heating</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='fuelused' ACCESSKEY='none' ><b style='color:red'>*</b>Current fuel used
</td>
<td class='ftbl_row_2a' ><select name='fuelused' id='fuelused'>
<option value='Gas'>Gas</option>
<option value='Oil'>Oil</option>
<option value='Other'>Other</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='otherfuel' ACCESSKEY='none' ><b style='color:red'>*</b>Other (if applicable)
</td>
<td class='ftbl_row_1a' ><input type='text' name='otherfuel' id='otherfuel' size='45' maxlength='30' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='heatingpercent' ACCESSKEY='none' ><b style='color:red'>*</b>What percentage of this is used for heating?
</td>
<td class='ftbl_row_2a' ><input type='text' name='heatingpercent' id='heatingpercent' size='45' maxlength='3' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='factoryspaceheating' ACCESSKEY='none' ><b style='color:red'>*</b>Factory Space Heating
</td>
<td class='ftbl_row_1a' ><input type='text' name='factoryspaceheating' id='factoryspaceheating' size='45' maxlength='100' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='officeheating' ACCESSKEY='none' ><b style='color:red'>*</b>Office Heating
</td>
<td class='ftbl_row_2a' ><input type='text' name='officeheating' id='officeheating' size='45' maxlength='3' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='hotwater' ACCESSKEY='none' ><b style='color:red'>*</b>Hot Water
</td>
<td class='ftbl_row_1a' ><input type='text' name='hotwater' id='hotwater' size='45' maxlength='3' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='heaterrating' ACCESSKEY='none' ><b style='color:red'>*</b>Combine Rating of Existing Heaters
</td>
<td class='ftbl_row_2a' ><input type='text' name='heaterrating' id='heaterrating' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='existingheaters' ACCESSKEY='none' ><b style='color:red'>*</b>Number of existing heaters
</td>
<td class='ftbl_row_1a' ><input type='text' name='existingheaters' id='existingheaters' size='45' maxlength='4' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='setbackheating' ACCESSKEY='none' ><b style='color:red'>*</b>Is night set back heating employed?
</td>
<td class='ftbl_row_2a' ><select name='setbackheating' id='setbackheating'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='billavalable' ACCESSKEY='none' ><b style='color:red'>*</b>Are they avalable?
</td>
<td class='ftbl_row_1a' ><select name='billavalable' id='billavalable'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='factorysize' ACCESSKEY='none' ><b style='color:red'>*</b>Factory Size
</td>
<td class='ftbl_row_2a' ><input type='text' name='factorysize' id='factorysize' size='45' maxlength='60' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='roofheighte' ACCESSKEY='none' ><b style='color:red'>*</b>Roof Height to Eaves
</td>
<td class='ftbl_row_1a' ><input type='text' name='roofheighte' id='roofheighte' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='roofheightr' ACCESSKEY='none' ><b style='color:red'>*</b>Roof Height to Ridge
</td>
<td class='ftbl_row_2a' ><input type='text' name='roofheightr' id='roofheightr' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='builddate' ACCESSKEY='none' ><b style='color:red'>*</b>Approx. Date building was built
</td>
<td class='ftbl_row_1a' ><input type='text' name='builddate' id='builddate' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='spraybooths' ACCESSKEY='none' ><b style='color:red'>*</b>Spray Booths?
</td>
<td class='ftbl_row_2a' ><select name='spraybooths' id='spraybooths'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='dustextract' ACCESSKEY='none' ><b style='color:red'>*</b>Dust Extraction
</td>
<td class='ftbl_row_1a' ><select name='dustextract' id='dustextract'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='air' ACCESSKEY='none' ><b style='color:red'>*</b>Is the air returned to the building?
</td>
<td class='ftbl_row_2a' ><select name='air' id='air'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='rollershutters' ACCESSKEY='none' ><b style='color:red'>*</b>Roller Shutters?
</td>
<td class='ftbl_row_1a' ><select name='rollershutters' id='rollershutters'>
<option value='Yes'>Yes</option>
<option value='No'>No</option>
</select>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='weekoc' ACCESSKEY='none' ><b style='color:red'>*</b>Weekly building occupancy
</td>
<td class='ftbl_row_2a' ><input type='text' name='weekoc' id='weekoc' size='45' maxlength='10' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='occupancy' ACCESSKEY='none' ><b style='color:red'>*</b>Daily Building Occupancy
</td>
<td class='ftbl_row_1a' ><input type='text' name='occupancy' id='occupancy' size='45' maxlength='5' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='woodwaste' ACCESSKEY='none' ><b style='color:red'>*</b>Type of wood waste
</td>
<td class='ftbl_row_2a' ><input type='text' name='woodwaste' id='woodwaste' size='45' maxlength='30' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_1' ><LABEL for='woodavailable' ACCESSKEY='none' ><b style='color:red'>*</b>Quantity available per wek
</td>
<td class='ftbl_row_1a' ><input type='text' name='woodavailable' id='woodavailable' size='45' maxlength='20' value=''>
</td>
</tr>
<tr>
<td class='ftbl_row_2' ><LABEL for='upload' ACCESSKEY='none' ><b style='color:red'>*</b>Upload bills here.
</td>
<td class='ftbl_row_2a' ><input type='file' name='upload' id='upload' size='100' value=''>
</td>
</tr>
<tr>
<td colspan='2' align='right'><input type='submit' name='submit' value='Submit' onclick="function verifyMe()" > <input type='reset' name='reset' value='Reset'><br /><a href='http://www.Jaynetdesign.com.com' style='font-family:arial;font-size:10px;color:#C0C0C0;text-decoration:none'>Created by James Eley</a>
</td>
</tr>
</table>
</form>
</div>
</body>
</HTML>
Key info is on lines: 138 - 152
if(msg!=''){
alert('The following fields are empty or invalid:\n\n'+msg);
return false
}else{
document.carbonform.submit();
return true }
}
<form name='carbonform' action="process.php" method='POST' enctype='application/x-www-form-urlencoded' onsubmit='return verifyMe();'>
and 441.
<td colspan='2' align='right'><input type='submit' name='submit' value='Submit' onclick="function verifyMe()" > <input type='reset' name='reset' value='Reset'>
My php script just contains an echo to test.
Thanks in advance.