Framework Theme Body Tag
Hi,
I am using a Frameowk Theme. Now I want to use the the Cookie Behavior to store my from.
But I cant use the BODY tag in the page I created from the Theme?
How can I use the onload Cookie in the body tag?
Cheers,
Denis
Hi,
I am using a Frameowk Theme. Now I want to use the the Cookie Behavior to store my from.
But I cant use the BODY tag in the page I created from the Theme?
How can I use the onload Cookie in the body tag?
Cheers,
Denis
select the form tag and apply the behavior to the onchange event of the form tag, then cut the code from the onchange event that is generated and paste it to a new script tag at the end of the page:
so you will have the form tag with the onchange to set the form from the cookies:
<form ...... onchange="<set form from cookie code>"
copy the code from the onchange event to a new script tag:
<script type="text/javascript">
<set form from cookie code>
</script>
This will execute the code when the page is loaded.
Hi Jason,
I think I am doing something wrong :-)
register.php
Attached is the register file
Maybe you can take a look.
Denis
your page should have the following code in the head:
<script src="../webassist/cookies/cookies.js"></script>
<script type="text/javascript">
function WA_getFormCookie(cookieObj, formObj, cookieName) {
cookieFormFromString(cookieObj,formObj,cookieName);
}
</script>
Hi Jason,
so this is the code I should put at the end in the post before?
<script type="text/javascript">
function WA_getFormCookie(cookieObj, formObj, cookieName) {
cookieFormFromString(cookieObj,formObj,cookieName);
}
</script>
Why is the code
<script src="../webassist/cookies/cookies.js"></script>
not set automatic? Even if I use normal pages it wont be in the code?
It only was written when I used the Show Cookie on Page behavior.
So I give it a try...
Cheers
Denis
you need both pieces of code, in the head of the document.
I logged a bug for the script not being added.
ok I think I got it.
in the head
<script src="../webassist/cookies/cookies.js"></script>
<script type="text/javascript">
function WA_getFormCookie(cookieObj, formObj, cookieName) {
cookieFormFromString(cookieObj,formObj,cookieName);
}
</script>
<script type="text/javascript">
function WA_setFormCookie(cookieObj, formObj, cookieName, expdays) {
if (expdays) {
cookieObj.expires = daysToExpire(expdays);
}
else {
cookieObj.expires = "";
}
cookieFormToString(cookieObj,formObj,cookieName);
}
</script>
Link to the script, Function Get the Cookie, Function Set the Cookie
in the Form onSubmit store the form
<form action="" method="post" name="formRegister" id="formRegister" onSubmit="WA_setFormCookie(WA_CookieObj,document.formRegister,'WAFC_register_formRegister', 1)">
at the end of the form to set the form
<script type="text/javascript">
WA_getFormCookie(WA_CookieObj,document.formRegister,'WAFC_register_formRegister');
</script>
Why are the functions and the link to the script not set automatic?
Cheers,
Denis
Hi Jason,
works now.
Thanks a lot for helping!
Denis
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.