Jump to content


This topic is now archived and is closed to further replies.


Restoring Form Values while using javascript history object with php

Recommended Posts


Thank u all. for the last two problems, i have posted, i got the answer and i finished it also. thank you very much.

I just want to know, whether it is possible for retaining posted form values, when user presses the back buttton which is using the javascript history command.

What i want to do is, when user posted the values, i have to take them to the confirmation or update page, if they press confirm, then the values will be stored into our database, if they press update, they have to go back to the previous and can edit the values.

Here the form is dynamically generated using PHP. I tried this, i can able to go back, but not able to get the form values.

kindly help me out.

the script is

function doBack()

[size=10pt]the form is [/size]

echo "<form method='POST' action='ord_confirm.php' name='confirm_form'>";
echo "<input type='hidden' name='Sno{$j}' value='{$GLOBALS['item_no']}'>";
echo "<input type='hidden' name='pr_cat{$j}' value='{$GLOBALS['prod_cat']}'>";
echo "<input type='hidden' name='qty_req{$j}' value='{$GLOBALS['qty']}'>";
echo "<input type='hidden' name='gsm{$j}' value='{$GLOBALS['gsm']}'>";
echo "<input type='hidden' name='desc{$j}' value='{$GLOBALS['desc']}'>";
echo "<input type='hidden' name='quality{$j}' value='{$GLOBALS['quality']}'>";
echo "<input type='hidden' name='width{$j}' value='{$GLOBALS['width']}'>";
echo "<input type='hidden' name='length{$j}' value='{$GLOBALS['length']}'>";
echo "<input type='hidden' name='quan{$j}' value='{$GLOBALS['quan']}'>";
echo "<input type='hidden' name='unit{$j}' value='{$GLOBALS['unit']}'>";
echo "<input type='hidden' name='price{$j}' value='{$GLOBALS['price']}'>";
echo "<input type='hidden' name='uprice{$j}' value='{$GLOBALS['uprice']}'>";
echo "<input type='hidden' name='remark{$j}' value='{$GLOBALS['remark']}'>";
echo "<input type='hidden' name='dis{$j}' value='{$GLOBALS['dis']}'>";
echo "<input type='hidden' name='un_k{$j}' value='{$GLOBALS['un_k']}'>";
//echo "<input type='hidden' name='un_k{$j}' value='{$GLOBALS['un_k']}'>";

                  <?php }

                echo "<input name='ret_tot' type='hidden' value='$j'>";
echo "<input type='hidden' name='enq_type' value='$enq_type'>";
echo "<input type='submit' name='ok' value='CONFIRM'>";
echo "<input type='reset' name='cancel' value='CANCEL' onclick='doBack();'";
        echo "</form>";


Share this post

Link to post
Share on other sites
Can't be done AFAIK using IE back button, but creating your own LINK with the back button could work.

Why would you want to support this feature?

Share this post

Link to post
Share on other sites
hi keeB,

i want this option so that user can edit there values if they want to .

I have seen this is normal shopping cart sites, where in which we can anytime update the quantity values or how much we want. I know they are made of pure PHP, in my case, it is not a shopping cart, so i am just looking for a quick work for this.

if you know, kindly tell me the logic for this.

[color=red][quote]note: I am not using browser's back button directly, there will be a button called update, when user clicks this button then it should go.[/quote][/color]


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.