PDA

View Full Version : Recall Form Values script II



micromaniaque
06-30-2011, 01:56 PM
1) Script Title: :: Recall Form Values script II

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

3) Describe problem: is it possible to use it twice in the same website once in English and the other one in Franch?

Best Regards

ddadmin
06-30-2011, 07:48 PM
Certainly. I assume the two forms will be on two different pages. If so, the only thing you should make sure is that the ID of the two forms are different, as that's what the script uses as the cookie name for each form, and hence should be unique. So for example:

On first page:


<form id="englishform">
<input id="woot" type="text" value="" /><br/>
<input id="woot2" type="text" value="" />
<input type="submit" value="submit" /><br />

<input type="checkbox" id="persistbox" /> Remember my info?
</form>

<script type="text/javascript">
var f1=new rememberForm("englishform") //create instance of script referencing form "englishform"
f1.persistfields("woot", "woot2") //specify the text fields "woot" and "woot2" to be remembered
f1.addtoggle("persistbox") //specify the checkbox "persistbox" as the " toggle box". (optional).
</script>

On second page:


<form id="frenchform">
<input id="woot" type="text" value="" /><br/>
<input id="woot2" type="text" value="" />
<input type="submit" value="submit" /><br />

<input type="checkbox" id="persistbox" /> Remember my info?
</form>

<script type="text/javascript">
var f1=new rememberForm("frenchform") //create instance of script referencing form "frenchform"
f1.persistfields("woot", "woot2") //specify the text fields "woot" and "woot2" to be remembered
f1.addtoggle("persistbox") //specify the checkbox "persistbox" as the " toggle box". (optional).
</script>