Jonathan Lyon
Jonathan Lyon

Reputation: 3952

pass a form value to another form on a different page without using url variables (javascript)

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

Upvotes: 0

Views: 1392

Answers (2)

wiifm
wiifm

Reputation: 3798

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

Upvotes: 3

BoltBait
BoltBait

Reputation: 11489

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

Upvotes: 0

Related Questions