PDA

View Full Version : Required form field script help...



jason001
Jul 15th, 2005, 03:25 PM
I'm using some javascript code for form fields that show an initial value in each field. When a user clicks the field the initial value disappears. When I try and add "required field" script, its reading the initial value and allowing the form to process.

Here is the script:

<form action="" method="post" name="form2" onSubmit="MM_validateForm('Name','','R','Company','','R','Address','','R','City','','R','State or Region','','R','Zip Code or Postal Code','','R','Phone','','R','Email','','RisEmail');return document.MM_returnValue">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><!--DWLayoutTable-->
<TBODY>
<TR>
<TD width=515 height=422 valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="32" valign="top" class="headerborders"><div style="margin-top:15px; margin-bottom:3px"><img src="images/req_quote_header.gif" width="200" height="14"></div></td>
</tr>
<tr>
<td width="515" height="423"><div style="margin-top:25px">
<p>If you would like to request a quote please complete the form to the right. Some fields are mandatory as marked. The more complete the information provided the sooner a Sales Associate will be able to get back to you with a response. Every effort will be made to respond the same day the inquiry is received. </p>
<p class="datacenter-headers">Enter up to 3 part numbers for quoting. </p>
<table width="515">
<tr>
<td height="65" valign="middle" background="images/req_quote_arts_08.gif">
<img src="images/spacer.gif" width="1" height="42"><img src="images/req_quote_art1_03.gif" width="31" height="26" align="absbottom">&nbsp;
<input name="part number" type="text" class="TEXTFIELD" id="part number" onblur="if(this.value==''){this.value=' Enter Part Number'}" onclick="javascript: if(this.value==' Enter Part Number'){this.value=''}" value=" Enter Part Number" size="28">
---
<input type="text" class="TEXTFIELD" onblur="if(this.value==''){this.value=' Manufacturer'}" onclick="javascript: if(this.value==' Manufacturer'){this.value=''}" value=" Manufacturer" size="20">
---
<input name="Quantity" type="text" class="TEXTFIELD" id="Quantity" onblur="if(this.value==''){this.value=' Quantity'}" onclick="javascript: if(this.value==' Quantity'){this.value=''}" value=" Quantity" size="15">
---
<input name="Delivery Date" type="text" class="TEXTFIELD" id="Delivery Date" onblur="if(this.value==''){this.value=' Delivery Date'}" onclick="javascript: if(this.value==' Delivery Date'){this.value=''}" value=" Delivery Date" size="15"> </td>
</tr>
</table>
<table width="515">
<tr>
<td height="65" valign="middle" background="images/req_quote_arts_08.gif">
<img src="images/spacer.gif" width="1" height="42"><img src="images/req_quote_art1b_03.gif" width="31" height="26" align="absbottom">&nbsp;
<input name="part number" type="text" class="TEXTFIELD" id="part number" onblur="if(this.value==''){this.value=' Enter Part Number'}" onclick="javascript: if(this.value==' Enter Part Number'){this.value=''}" value=" Enter Part Number" size="28">
---
<input type="text" class="TEXTFIELD" onblur="if(this.value==''){this.value=' Manufacturer'}" onclick="javascript: if(this.value==' Manufacturer'){this.value=''}" value=" Manufacturer" size="20">
---
<input name="Quantity" type="text" class="TEXTFIELD" id="Quantity" onblur="if(this.value==''){this.value=' Quantity'}" onclick="javascript: if(this.value==' Quantity'){this.value=''}" value=" Quantity" size="15">
---
<input name="Delivery Date" type="text" class="TEXTFIELD" id="Delivery Date" onblur="if(this.value==''){this.value=' Delivery Date'}" onclick="javascript: if(this.value==' Delivery Date'){this.value=''}" value=" Delivery Date" size="15"> </td>
</tr>
</table>
<table width="515">
<tr>
<td height="65" valign="middle" background="images/req_quote_arts_08.gif">
<img src="images/spacer.gif" width="1" height="42"><img src="images/req_quote_art1c_03.gif" width="31" height="26" align="absbottom">&nbsp;
<input name="part number" type="text" class="TEXTFIELD" id="part number" onblur="if(this.value==''){this.value=' Enter Part Number'}" onclick="javascript: if(this.value==' Enter Part Number'){this.value=''}" value=" Enter Part Number" size="28">
---
<input type="text" class="TEXTFIELD" onblur="if(this.value==''){this.value=' Manufacturer'}" onclick="javascript: if(this.value==' Manufacturer'){this.value=''}" value=" Manufacturer" size="20">
---
<input name="Quantity" type="text" class="TEXTFIELD" id="Quantity" onblur="if(this.value==''){this.value=' Quantity'}" onclick="javascript: if(this.value==' Quantity'){this.value=''}" value=" Quantity" size="15">
---
<input name="Delivery Date" type="text" class="TEXTFIELD" id="Delivery Date" onblur="if(this.value==''){this.value=' Delivery Date'}" onclick="javascript: if(this.value==' Delivery Date'){this.value=''}" value=" Delivery Date" size="15"> </td>
</tr>
</table>
<table width="100%" cellspacing="3" >
<tr valign="middle">
<td colspan="10"><span class="style2">*</span> Enter your information in the <span class="style2">required</span> fields to proceed. <br>
<img src="images/spacer.gif" width="1" height="15"></td>
</tr>
<tr>
<td width="11%" valign="bottom"><div align="right" class="style2">3.</div></td>
<td colspan="4"><input name="Name" type="text" onblur="if(this.value==''){this.value=' Name'}" onclick="javascript: if(this.value==' Name'){this.value=''}" class="TEXTFIELD" id="Name" value=" Name" size="40"></td>
<td width="52%" colspan="5" rowspan="7">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<textarea name="SpecialInstructions" cols="40" rows="11" onblur="if(this.value==''){this.value=' Special Instructions'}" onclick="javascript: if(this.value==' Special Instructions'){this.value=''}" class="TEXTFIELD" id="SpecialInstructions"> Special Instructions</textarea></td>
</tr>
<tr>
<td valign="bottom"><div align="right" class="style2">4.</div></td>
<td colspan="4"><input name="Company" type="text" onblur="if(this.value==''){this.value=' Company'}" onclick="javascript: if(this.value==' Company'){this.value=''}" class="TEXTFIELD" id="Company" value=" Company" size="40"></td>
</tr>
<tr>
<td valign="bottom"><div align="right" class="style2">5.</div></td>
<td colspan="4"><input name="Address" type="text" onblur="if(this.value==''){this.value=' Address'}" onclick="javascript: if(this.value==' Address'){this.value=''}" class="TEXTFIELD" id="Address" value=" Address" size="40"></td>
</tr>
<tr>
<td valign="bottom"><div align="right" class="style2">6.</div></td>
<td colspan="4"><input name="City" type="text" onblur="if(this.value==''){this.value=' City'}" onclick="javascript: if(this.value==' City'){this.value=''}" class="TEXTFIELD" id="City" value=" City" size="40"></td>
</tr>
<tr>
<td valign="bottom"><div align="right" class="style2">7.</div></td>
<td colspan="4"><input name="State or Region" type="text" onblur="if(this.value==''){this.value=' State or Region'}" onclick="javascript: if(this.value==' State or Region'){this.value=''}" class="TEXTFIELD" id="State or Region" value=" State or Region" size="40"></td>
</tr>
<tr>
<td valign="bottom"><div align="right" class="style2">8.</div></td>
<td colspan="4"><input name="Zip Code or Postal Code" type="text" onblur="if(this.value==''){this.value=' Zip Code or Postal Code'}" onclick="javascript: if(this.value==' Zip Code or Postal Code'){this.value=''}" class="TEXTFIELD" id="Zip Code or Postal Code" value=" Zip Code or Postal Code" size="40"></td>
</tr>
<tr>
<td valign="bottom"><div align="right" class="style2">9.</div></td>
<td colspan="4"><input name="Phone" type="text" onblur="if(this.value==''){this.value=' Phone'}" onclick="javascript: if(this.value==' Phone'){this.value=''}" class="TEXTFIELD" id="Phone" value=" Phone" size="40"></td>
</tr>
<tr>
<td valign="bottom"><div align="right">10.</div></td>
<td colspan="4"><input name="Fax" type="text" onblur="if(this.value==''){this.value=' Fax'}" onclick="javascript: if(this.value==' Fax'){this.value=''}" class="TEXTFIELD" id="Fax" value=" Fax" size="40"></td>
<td colspan="5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method of contact:
<input type="radio" name="Contact" value="Phone">Phone
<input type="radio" name="Contact" value="Fax">Fax
<input type="radio" name="Contact" value="Email">E-mail
</td>
</tr>
<tr>
<td valign="bottom"><div align="right" class="style2">11.</div></td>
<td colspan="4"><input name="Email" type="text" onblur="if(this.value==''){this.value=' E-mail'}" onclick="javascript: if(this.value==' E-mail'){this.value=''}" class="TEXTFIELD" id="Email" value=" E-mail" size="40"></td>
<td colspan="5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Customer type?
<input type="radio" name="Customer" value="New Customer">New
<input type="radio" name="Customer" value="Existing Customer">Existing
</td>
</tr>
<tr>
<td colspan="10"><div align="center" style="margin-top:20px; margin-bottom:25px">
<input name="Submit" type="submit" class="button2" id="Submit" value="Submit">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="Submit22" type="reset" class="button2" value="Reset">
</div></td>
</tr>
</table>
</div></td>
</tr>

</table></TD></TR>
</TBODY></TABLE></form>


Thanks for the help!!
-Jason

medigerati
Jul 15th, 2005, 06:42 PM
Try this:

Say you want to check your 'Part Number' and 'Manufacturer' field. Add this script to your MM_validateForm function:



var partNumber = document.form2.element('part number').value;
if(partNumber== ' Enter Part Number' || partNumber.length===0){
partNumber = FALSE;
}

var deliveryDate = document.form2.element('Delivery Date').value;
if(deliveryDate == ' Delivery Date' || deliveryDate .length===0){
deliveryDate = FALSE;
}

if(partNumber && deliveryDate){
return true;
}
else{
return false;
}


Also, make sure you have a name for all your textboxes. Manufacturer and others don't have a name.

Hopefully that helps,
Kevin

jason001
Jul 15th, 2005, 09:42 PM
Hi Kevin,

I tried to make it work but I'm just too wet behind the ears.
Here is the top half of the source for the page. If you have time maybe you could through the code in for me?? :) If I have a working example I can add the rest.
If you can't, no biggie, thank your for you time and help anyway.


<HTML><!-- InstanceBegin template="/Templates/index_template.dwt" codeOutsideHTMLIsLocked="false" --><HEAD><!-- InstanceBeginEditable name="doctitle" -->
<TITLE>Request a Quote - Dove Electronic Components, Inc. - The Crystal and Oscillator Specialist</TITLE>
<!-- InstanceEndEditable -->
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><LINK href="style.css" type=text/css rel=stylesheet>
<STYLE type=text/css>
<!--
.largewhite {
font-family: Tahoma;
font-size: 13px;
font-weight: bold;
color: #FFFFFF;
}
.tabborder {
border: 1px solid #BCBC95;
}
.headback {
background-image: url(images/dovehome_11.gif);
background-repeat: repeat-x;
background-position: bottom;
}
.searchback {
background-image: url(images/dovehome_14.gif);
background-repeat: repeat-x;
background-position: bottom;
}
.headbacktop {
background-image: url(images/dovehome_11.gif);
background-repeat: repeat-x;
background-position: top;
}
body {
margin-bottom: 20px;
}
-->

</STYLE>
<META content="MSHTML 6.00.2600.0" name=GENERATOR><!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
.style2 {color: #EC7000}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
<!-- InstanceEndEditable --></HEAD>
<BODY bgColor=#ffffff leftMargin=0 marginwidth="0">
<script language="JavaScript1.2" vqm_id="mydata.js">

vqm__notice='Visual QuickMenu Pro, (c) 2004 OpenCube Inc., All Rights Reserved, Visit - www.opencube.com';

vqm__codebase='';
vqm__database='';

</script>
<script language="JavaScript1.2" src="mydata.js"></script>
<script language="JavaScript1.2" src="tdqm_loader.js"></script>
<TABLE class=tabborder cellSpacing=0 cellPadding=0 width=766 align=center border=0><!--DWLayoutTable-->
<TBODY>
<TR>
<TD vAlign=top width=766 height=110>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><!--DWLayoutTable-->
<TBODY>
<TR>
<TD vAlign=top width=531 height=110><IMG height=110 src="images/dovehome_01.jpg" width=531></TD>
<TD vAlign=top width=235 bgColor=#445565>
<DIV class=top style="MARGIN-TOP: 20px; MARGIN-LEFT: 5px">Dove Electronic Components, Inc.<BR>39 Research Way, East Setauket, NY 11784 </DIV>
<DIV class=top style="MARGIN-TOP: 5px; MARGIN-LEFT: 5px"><STRONG>1-800-232-9825<BR>fax: 1-631-689-7362</STRONG></DIV></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD vAlign=top height=38>
<TABLE cellSpacing=0 cellPadding=0 width=766 border=0><!--DWLayoutTable-->
<TBODY>
<TR>
<TD width=290 background=images/m0.gif height=38>
<DIV style="MARGIN-TOP: 15px; MARGIN-LEFT: 130px"> <A href="#">Login</A><IMG height=6 src="images/spacer.gif" width=3 align=absMiddle>|<IMG height=6 src="images/spacer.gif" width=3 align=absMiddle><A href="#">Sign-up</A> </DIV></TD>
<TD align="left" valign="top">
<DIV style="margin-top:0px; margin-right:0px; margin-left:0px; margin-bottom:0px"><script id="vqp_generate_mainitems" language="javascript1.2">generate_mainitems()</script></DIV></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
<TR>
<TD vAlign=top height=181>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><!--DWLayoutTable-->
<TBODY>
<TR>
<TD vAlign=top width=209 rowSpan=2><IMG height=180 src="images/dovehome_09.jpg" width=209 useMap=#Map border=0></TD>
<TD vAlign=top colSpan=2 height=70><IMG height=70 src="images/dovehome_10.gif" width=236></TD>
<TD class=headbacktop vAlign=top width=25><IMG height=1 src="images/spacer.gif" width=1></TD>
<TD vAlign=top width=26 rowSpan=2><IMG height=180 src="images/dovehome_12.gif" width=26></TD>
<TD vAlign=top colSpan=2><IMG height=70 src="images/dovehome_13.gif" width=270></TD></TR>
<TR>
<TD width=16 height=110 vAlign=top class=headback><IMG height=1 src="images/spacer.gif" width=1></TD>
<TD colSpan=2 vAlign=top class=searchback>
<DIV style="MARGIN-TOP:11px">
<FORM action="" method=get>
<INPUT class=button2 size=30 value=" Search by Part #">
<DIV style="MARGIN-TOP: 7px"><span class="headerFileCopy"><span class="unnamed2">
<SELECT name="Mfg" size=1 class="button2">
<option value="ALL" selected>Search by Manufacturer</option>
<option value="ABR">ABRACON CORPORATION </option>
<option value="ACT">ADVANCED CRYSTAL</option>
<option value="ADV">ADVANTEK </option>
<option value="AND">ANDERSON ELECTRONICS INC. </option>
<option value="AVX">AVX/KYOCERA </option>
<option value="BMR">BOMAR CRYSTAL COMPANY </option>
<option value="CMA">C-MAC QUARTZ CRYSTALS </option>
<option value="CAL">CAL CRYSTAL INC./COMCLOK INC. </option>
<option value="CAP">CAP </option>
<option value="CAR">CARDINAL COMPONENTS INC. </option>
<option value="CES">CESIWID </option>
<option value="CHA">CHAMPION TECHNOLOGIES INC. </option>
<option value="CIT">CITIZEN </option>
<option value="CS">CRYSTAL SEMICONDUCTOR </option>
<option value="CRY">CRYSTEK CORPORATION </option>
<option value="CTS">CTS CORPORATION </option>
<option value="DAL">DALE </option>
<option value="ECL">ECLIPTEK CORPORATION </option>
<option value="ECS">ECS INC. </option>
<option value="EEC">EEC </option>
<option value="EDC">ELECTRO DYNAMICS CRYSTAL </option>
<option value="EPS">EPSON AMERICA INC. </option>
<option value="ETA">ETA </option>
<option value="FOX">FOX ELECTRONICS </option>
<option value="ICW">IC WORKS INC. </option>
<option value="ILS">ILSI AMERICA INC. </option>
<option value="ICS">INTEGRATED CIRCUIT SYS. INC. </option>
<option value="IQD">IQD LIMITED </option>
<option value="KAN">KANTHAL </option>
<option value="KDS">KDS AMERICA </option>
<option value="KSS">KSS </option>
<option value="MTN">M-TRON INDUSTRIES INC. </option>
<option value="MAR">MARDEN </option>
<option value="MEI">MEIDEN </option>
<option value="MER">MERCURY UNITED ELECT. INC. </option>
<option value="MFE">MF ELECTRONICS </option>
<option value="MPC">MONITOR PRODUCTS CO. INC. </option>
<option value="NDK">NDK AMERICA INC. </option>
<option value="NEL">NEL FREQUENCY CONTROLS INC. </option>
<option value="PLA">PLAINVIEW BATTERIES INC. </option>
<option value="PLE">PLETRONICS INC. </option>
<option value="PDI">PRECISION DEVICES INC. </option>
<option value="QUA">QUARTZTEK </option>
<option value="RAL">RALTRON ELECTRONICS CORP. </option>
<option value="RXD">RXD INC. </option>
<option value="SRX">SARONIX </option>
<option value="STD">STANDARD CRYSTAL CORP. </option>
<option value="STK">STATEK </option>
<option value="TOY">TOYOCOM </option>
<option value="UNI">UNIDEN </option>
<option value="USC">UNITED STATES CRYSTAL CORP. </option>
<option value="VFR">VALPEY-FISHER CORPORATION </option>
</select>
</span></span> <IMG height=1 src="images/spacer.gif" width=0>
<INPUT class=button2 type=submit value=GO name=Submit>
</DIV>
</FORM>
</DIV></TD>
<TD width=16 vAlign=top class=headback><IMG height=1 src="images/spacer.gif" width=1></TD>
<TD width=254 vAlign=top class=searchback>
<DIV style="MARGIN-TOP: 6px">
<FORM action="" method=get>
Select a manufacturer to start your data search.<BR>
All data sheets are in .PDF format.
<DIV style="MARGIN-TOP: 7px"><span class="headerFileCopy"><span class="unnamed2">
<SELECT name="Mfg" size=1 class="button2">
<option value="ALL" selected>Search by Manufacturer</option>
<option value="ABR">ABRACON CORPORATION </option>
<option value="ACT">ADVANCED CRYSTAL</option>
<option value="ADV">ADVANTEK </option>
<option value="AND">ANDERSON ELECTRONICS INC. </option>
<option value="AVX">AVX/KYOCERA </option>
<option value="BMR">BOMAR CRYSTAL COMPANY </option>
<option value="CMA">C-MAC QUARTZ CRYSTALS </option>
<option value="CAL">CAL CRYSTAL INC./COMCLOK INC. </option>
<option value="CAP">CAP </option>
<option value="CAR">CARDINAL COMPONENTS INC. </option>
<option value="CES">CESIWID </option>
<option value="CHA">CHAMPION TECHNOLOGIES INC. </option>
<option value="CIT">CITIZEN </option>
<option value="CS">CRYSTAL SEMICONDUCTOR </option>
<option value="CRY">CRYSTEK CORPORATION </option>
<option value="CTS">CTS CORPORATION </option>
<option value="DAL">DALE </option>
<option value="ECL">ECLIPTEK CORPORATION </option>
<option value="ECS">ECS INC. </option>
<option value="EEC">EEC </option>
<option value="EDC">ELECTRO DYNAMICS CRYSTAL </option>
<option value="EPS">EPSON AMERICA INC. </option>
<option value="ETA">ETA </option>
<option value="FOX">FOX ELECTRONICS </option>
<option value="ICW">IC WORKS INC. </option>
<option value="ILS">ILSI AMERICA INC. </option>
<option value="ICS">INTEGRATED CIRCUIT SYS. INC. </option>
<option value="IQD">IQD LIMITED </option>
<option value="KAN">KANTHAL </option>
<option value="KDS">KDS AMERICA </option>
<option value="KSS">KSS </option>
<option value="MTN">M-TRON INDUSTRIES INC. </option>
<option value="MAR">MARDEN </option>
<option value="MEI">MEIDEN </option>
<option value="MER">MERCURY UNITED ELECT. INC. </option>
<option value="MFE">MF ELECTRONICS </option>
<option value="MPC">MONITOR PRODUCTS CO. INC. </option>
<option value="NDK">NDK AMERICA INC. </option>
<option value="NEL">NEL FREQUENCY CONTROLS INC. </option>
<option value="PLA">PLAINVIEW BATTERIES INC. </option>
<option value="PLE">PLETRONICS INC. </option>
<option value="PDI">PRECISION DEVICES INC. </option>
<option value="QUA">QUARTZTEK </option>
<option value="RAL">RALTRON ELECTRONICS CORP. </option>
<option value="RXD">RXD INC. </option>
<option value="SRX">SARONIX </option>
<option value="STD">STANDARD CRYSTAL CORP. </option>
<option value="STK">STATEK </option>
<option value="TOY">TOYOCOM </option>
<option value="UNI">UNIDEN </option>
<option value="USC">UNITED STATES CRYSTAL CORP. </option>
<option value="VFR">VALPEY-FISHER CORPORATION </option>
</select>
</span></span> <IMG height=1 src="images/spacer.gif" width=0>

</DIV>
</FORM>
</DIV></TD>
</TR>
<tr>
<td height="0"></td>
<td></td>
<td width="220"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</TBODY></TABLE></TD></TR>
<TR>
<TD vAlign=top height=529>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><!--DWLayoutTable-->
<TBODY>
<TR>
<TD vAlign=top width=209 rowSpan=2>
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#d9d9d9 border=0><!--DWLayoutTable-->
<TBODY>
<TR bgColor=#ffffff>
<TD vAlign=top colSpan=3 height=120>
<DIV style="PADDING-RIGHT: 20px; PADDING-LEFT: 23px; PADDING-BOTTOM: 10px; PADDING-TOP: 20px"><IMG height=11 src="images/text1.gif" width=101><BR><BR><SPAN class="blue t11">[ 3.05.05 ] - Dove announces the acuisistion of Arrow Elecetronics</SPAN>. The 1.5 billion dollar deal is a first of its kind.<BR><IMG height=12 src="images/spacer.gif"><BR><IMG src="images/hline1.gif"></DIV></TD></TR>
<TR bgColor=#ffffff>
<TD vAlign=top colSpan=3 height=75>
<DIV style="PADDING-RIGHT: 20px; PADDING-LEFT: 23px; PADDING-BOTTOM: 10px"><SPAN class="blue t11">[ 3.05.05 ] - Dove announces the acuisistion of Arrow Elecetronics</SPAN>. The 1.5 billion dollar deal is a first of its kind.<BR><IMG height=12 src="images/spacer.gif"><BR><IMG src="images/hline1.gif"></DIV></TD></TR>
<TR>
<TD vAlign=top width=23 bgColor=#ffffff height=110><IMG height=1 src="images/spacer.gif" width=20></TD>
<TD class=pbbackground vAlign=top width=166 bgColor=#ffffff>
<DIV style="MARGIN-TOP: 28px; MARGIN-BOTTOM: 10px; MARGIN-LEFT: 90px">Visit our Pb free page for useful information on conversion scheduling and more.&nbsp;&nbsp;<A href="pbfree.htm">pb free </A></DIV></TD>
<TD vAlign=top width=20 bgColor=#ffffff><IMG height=1 src="images/spacer.gif" width=20></TD></TR>
<TR>
<TD vAlign=top bgColor=#ffffff rowSpan=2><!--DWLayoutEmptyCell-->&nbsp;</TD>
<TD vAlign=top height=1><IMG height=1 src="images/hline1.gif" width=165></TD>
<TD vAlign=top bgColor=#ffffff rowSpan=2><!--DWLayoutEmptyCell-->&nbsp;</TD></TR>
<TR>
<TD vAlign=top bgColor=#ffffff height=120>
<DIV style="MARGIN-TOP: 10px; MARGIN-BOTTOM: 10px"><IMG height=100 src="images/engineering-binder.gif" width=165></DIV></TD></TR>
<TR bgColor=#d9d9d9>
<TD vAlign=top colSpan=3 height=116>
<DIV style="MARGIN-TOP: 20px; MARGIN-LEFT: 20px">
<P><IMG height=11 src="images/text2.gif" width=95></P>
<FORM name=form1 action="" method=post>
<P><INPUT name=textfield> <INPUT type=image height=13 width=16 src="images/ok2.gif" border=0 name=imageField> <A href="#">cancel subscription</A> </P></FORM></DIV></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top width=21 rowSpan=2>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><!--DWLayoutTable-->
<TBODY>
<TR>
<TD vAlign=top width=21 height=542><IMG height=1 src="images/spacer.gif" width=1></TD></TR></TBODY></TABLE></TD>
<TD vAlign=top width=515 height=478><!-- InstanceBeginEditable name="main-table" -->
<form action="" method="post" name="form2" onSubmit="MM_validateForm('Name','','R','Company','','R','Address','','R','City','','R','State or Region','','R','Zip Code or Postal Code','','R','Phone','','R','Email','','RisEmail');return document.MM_returnValue">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0><!--DWLayoutTable-->
<TBODY>
<TR>
<TD width=515 height=422 valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="32" valign="top" class="headerborders"><div style="margin-top:15px; margin-bottom:3px"><img src="images/req_quote_header.gif" width="200" height="14"></div></td>
</tr>
<tr>
<td width="515" height="423"><div style="margin-top:25px">
<p>If you would like to request a quote please complete the form to the right. Some fields are mandatory as marked. The more complete the information provided the sooner a Sales Associate will be able to get back to you with a response. Every effort will be made to respond the same day the inquiry is received. </p>
<p class="datacenter-headers">Enter up to 3 part numbers for quoting. </p>
<table width="515">
<tr>

medigerati
Jul 16th, 2005, 11:40 PM
I'll see what I can do later this weekend

medigerati
Jul 19th, 2005, 05:47 AM
Oi,
this is ALOT of source to look at. :eek: Perhaps you could send me a link to your test page to have a look at so I can see the entire thing in action.

Kevin

jason001
Jul 19th, 2005, 01:47 PM
Hello,

Here is the MM_validateForm script.....thanks alot for your help!! :)

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>