saikiran Posted July 12, 2006 Share Posted July 12, 2006 hi,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[color=red]....<script>function doBack(){ history.go(-1);}</script>[/color]....[size=10pt]the form is [/size][color=red]<?php 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']}'>"; $j++; <?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>"; [/color]cheerssai Quote Link to comment https://forums.phpfreaks.com/topic/14360-restoring-form-values-while-using-javascript-history-object-with-php/ Share on other sites More sharing options...
keeB Posted July 12, 2006 Share Posted July 12, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/14360-restoring-form-values-while-using-javascript-history-object-with-php/#findComment-56605 Share on other sites More sharing options...
saikiran Posted July 12, 2006 Author Share Posted July 12, 2006 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]cheerssaisaisen76@hotmail.com Quote Link to comment https://forums.phpfreaks.com/topic/14360-restoring-form-values-while-using-javascript-history-object-with-php/#findComment-56611 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.