Hi Brad,

Here is a very simple example you could start from


Tom D

<html>
        <head>
                <SCRIPT language="JavaScript">
                        <!-- Begin javascript
                        function copyfield()
                                {
document.cookie ="examplefield1="+document.exampleform.examplefield1.value document.cookie ="examplefield2="+document.exampleform.examplefield2.value
                                }
                        
                        function ReadCookie(cookieName)
                                {
                                 var theCookie=""+document.cookie;
                                 var ind=theCookie.indexOf(cookieName);
                                 if (ind==-1 || cookieName=="") return "";
                                 var ind1=theCookie.indexOf(';',ind);
                                 if (ind1==-1) ind1=theCookie.length;
                                 return 
unescape(theCookie.substring(ind+cookieName.length+1,ind1));
                                }
                
                        function pastefield()
                                {
                                
document.exampleform.examplefield1.value=ReadCookie("examplefield1")
                                
document.exampleform.examplefield2.value=ReadCookie("examplefield2")
                                }
                        // End javascript -->
                </SCRIPT> 
        </head>
        <body id="infopg">
                <form name="exampleform" action="" method="post">
                        <table>
                                <tr>
                                        <td>examplefield 1</td>
                                        <td><input type="text" maxlength="20" 
name="examplefield1" /></td>
                                <tr>
                                <tr>
                                        <td>examplefield 2</td>
                                        <td><input type="text" maxlength="20" 
name="examplefield2" /></td>
                                <tr>
                                        <td></td>
<td align="right"><input type="button" name="Copy" value="Copy" onClick="copyfield();" /></td>
                                </tr>
                                <tr>
                                        <td></td>
<td align="right"><input type="button" name="Paste" value="Paste" onClick="pastefield();" /></td>
                                </tr>
                        </table>
                </form>   
        </body>
</html>

On Nov 14, 2006, at 5:25 PM, Brad Perkins wrote:

Basically I'm looking at this (pseudocode)

// To "Copy"
setPartsClipCookie(formVarsToJSON())


// To "Paste"
If (partsClipJSON = getPartsClipCookie()) {
   jsonToFormVars(partsClipJSON);
} else {
   alert ('Sorry, nothing to paste')
}

_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to