PDA

View Full Version : Recall Form Values Script II - Need Help



charmarsh
05-15-2007, 12:44 AM
1) Script Title: Recall Form Values Script II

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex16/formremember2.htm

3) Describe problem: I cannot get it to work at all. Does not remember info.

<script 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>
<script type="text/javascript" src="formretain2.js">

/***********************************************
* Recall Form Values script II- &#169; Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
<script type="text/javascript">
var f1=new rememberForm("cookie") //create instance of script referencing form "demoform"
f1.persistfields("firstname", "lastname", "address1", "phone1") //specify the text fields "woot" and "woot2" to be remembered
f1.addtoggle("togglebox") //specify the checkbox "persistbox" as the " toggle box". (optional).
</script>
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>

<body>
<form id="cookie" name="cookie" method="POST" action="registration-cookie.php">
<table width="700" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#D6941E">

<tr>
<td height="0" bgcolor="#D6941E"><div align="center"></div></td>
</tr>
<tr>
<td height="0" bgcolor="#FFFFFF"><table width="76&#37;" height="344" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#FFFFFF">
<tr>
<td width="184" height="15">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>

<tr>
<td width="184" height="15"><div align="right"></div></td>
<td width="12">&nbsp;</td>
<td width="333" height="24"><font color="#FF0000">Required * </font></td>
</tr>
<tr>
<td width="184" height="21"><div align="right">I Will Be<font color="#FF0000">*</font></div></td>
<td>&nbsp;</td>
<td><label>
<select name="select" class="formwidth-wide">
<option selected="selected">Select One</option>
<option>Selling</option>
<option>Buying</option>
<option>Both Buying and (Selling Locally)</option>
</select>
</label></td>
</tr>
<tr>
<td width="184" height="20"><div align="right">First Name<font color="#FF0000">*</font></div></td>
<td>&nbsp;</td>
<td onfocus="MM_validateForm('firstname','','R','lastname','','R','email','','RisEmail','address1','','R','phone1','','RisNum','phone2','','RisNum','phone3','','RisNum','pho ne4','','RisNum','phone5','','RisNum','phone6','','RisNum');return document.MM_returnValue"><input name="firstname" type="text" class="formwidth-wide" id="firstname" size="36" /></td>
</tr>
<tr>
<td width="184" height="20"><div align="right">Last Name<font color="#FF0000">*</font></div></td>
<td>&nbsp;</td>
<td><input name="lastname" type="text" class="formwidth-wide" id="lastname" size="36" /></td>
</tr>
<tr>
<td width="184" height="20"><div align="right">Email Address<font color="#FF0000">*</font></div></td>
<td>&nbsp;</td>
<td><label>
<input name="email" type="text" class="formwidth-wide" id="email" size="36" />
</label></td>
</tr>
<tr>
<td width="184" height="20"><div align="right">Home Address<font color="#FF0000">*</font></div></td>
<td>&nbsp;</td>
<td><input name="address1" type="text" class="formwidth-wide" id="address1" size="36" /></td>
</tr>
<tr>
<td width="184" height="20"><div align="right">Home Phone<font color="#FF0000">*</font></div></td>
<td>&nbsp;</td>
<td>(
<label>
<input name="phone1" type="text" id="phone1" size="6" maxlength="3" />
</label>
<label> )
<input name="phone2" type="text" id="phone2" size="6" maxlength="3" />
-
<input name="phone3" type="text" id="phone3" size="19" maxlength="4" />
</label></td>
</tr>
<tr>
<td width="184" height="20"><div align="right">Other Phone</div></td>
<td>&nbsp;</td>
<td>(
<input name="otherphone1" type="text" id="otherphone1" size="6" maxlength="3" />
<label> )
<input name="otherphone2" type="text" id="otherphone2" size="6" maxlength="3" />
-
<input name="otherphone3" type="text" id="otherphone3" size="19" maxlength="4" />
</label></td>
</tr>
<tr>
<td width="184" height="15"><div align="right"></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="184" height="21"><div align="right">Property Type</div></td>
<td>&nbsp;</td>
<td><select name="select2" class="formwidth-wide" id="select">
<option selected="selected">Residential</option>
<option>Land</option>
<option>Commercial</option>
<option>Other</option>
</select></td>
</tr>
<tr>
<td width="184" height="21"><div align="right">Time Frame</div></td>
<td>&nbsp;</td>
<td><select name="select3" class="formwidth-wide" id="select2">
<option>Immediately</option>
<option>Within 1 month</option>
<option>Within the next couple of months</option>
<option>Within 6 months</option>
<option>Within the year</option>
<option>Long range</option>
</select></td>
</tr>
<tr>
<td width="184" height="21"><div align="right">Preference</div></td>
<td>&nbsp;</td>
<td><select name="select4" class="formwidth-wide" id="select3">
<option selected="selected">Get Help From a Realtor&reg; Consultant</option>
<option>Search Properties Without a Realtor&reg;</option>
</select></td>
</tr>
<tr>
<td width="184" height="15"><div align="right"></div></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td width="184" height="21"><div align="right">
<input name="togglebox" type="checkbox" id="togglebox" value="checkbox" />
<font color="#FF0000">Remember Me</font></div></td>
<td width="12">&nbsp;</td>
<td width="333"><input name="Submit" type="submit" class="formwidth-wide" id="Submit" value="Submit for Absolutely FREE Unlimited Usage" /></td>
</tr>
<tr>
<td width="184" height="21">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table></td>
</tr>
</table>
</form>