views:

506

answers:

2

Hi

I have a form on a page and I want to pass a form inputbox value to another inputbox on another form on another page without using URL variables - is this possible?

They both share the same header page section if that is of any help.

Thanks

Jonathan

A: 

You could do it using a cookie, if both pages are on the same web server.

BoltBait
any possibility you can elaborate with a code sample please?
Jonathan Lyon
+2  A: 

To elaborate on @BoltBait - this is a basic example, using JQuery + the cookie plugin

On the first page

<script type="text/javascript">
    // set the cookie, on click to the next page
    $("#next-page").click(function() {
        $.cookie("INPUTBOX",$("input[name=inputbox]").val());
    });
</script>

And on the next page

<script type="text/javascript">
    // get the cookie, we are now on the next page
    alert($.cookie("INPUTBOX"));
</script>

Hope this helps

wiifm
Thanks- that really helped - much appreciated
Jonathan Lyon