window history back (-1) not working

I have use below code to back for the previous page, but it's not working. the alert box still popup even i click ok on the page. actually there have 3 page include this windows page code. 1st page is user need to fill up the form is name redeem_newcust.asp and the action should be save all the data into the database named redeem_newcustDB.asp. In page redeem_newcustDB.asp have one code to select option for type of redemption then this page will point action to the page redeem_newprocess.asp with is included as below code. Means when user click on type of redemption not equal to "Birthday Pack - PDV RM50" then it should be back to the previous page that means page redeem_newcustDB.asp. It's possible to having back to that previous page..? Should b need to bring all the value? Please help, thanks

If redeemtype = "Birthday Pack - PDV RM50" then
            <script language="javascript">
            window.alert ("Please choose Type of Redemption");
End If




Use: window.history.back() instead .go();

or use:

window.alert("Please choose Type of Redemption");

I would always avoid using alert(), since it kills script in some Browsers. I would open() a new window and ButtonElement.onclick use location =.


window is implicit, so you don't need to write or window.location. Additionally, it's fine to leave off .href when referring to location.href


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.