admin管理员组文章数量:1435273
In checkout page of my magento store, I need to clear some inputs when an alert box is showed and user press OK. Is possible to do that?
I have no control over the javascript alert. So I think in a script that detect an alert with a specific message and clear inputs when button of that alert is clicked.
UPDATE
Fixed!
file: opcheckout.js line: 888
I add location.reload();
because document.location.reload(true);
not work on IE. Thanks everybody!
In checkout page of my magento store, I need to clear some inputs when an alert box is showed and user press OK. Is possible to do that?
I have no control over the javascript alert. So I think in a script that detect an alert with a specific message and clear inputs when button of that alert is clicked.
UPDATE
Fixed!
file: opcheckout.js line: 888
I add location.reload();
because document.location.reload(true);
not work on IE. Thanks everybody!
- Could you clarify on which action magento shows alert? – Artem Latyshev Commented Jul 17, 2013 at 20:35
- @ArtemLatyshev I am using a payment module with credit cards and need to modify it to be accepted by the credit card pany. When the customer inserts a number of invalid credit card and click on Place order button, the module displays a message (alert). – user2433958 Commented Jul 17, 2013 at 20:40
3 Answers
Reset to default 3Probably try overriding default alert and write a custom function like below,
var c_alert = alert;
window.alert = function (str) { //override default alert
c_alert(str + ' my message');
location.reload();
//or write code to clear input fields here
}
//below seems to be triggered from somewhere where you don't have control.
alert('test');
Javascript
if(confirm('your confirmation text')){
document.location.reload(true);
}
Make it refresh after the alert. The javascript code shouldn't execute before the alert is gone
本文标签: javascriptRefresh the page after click OK on alert boxStack Overflow
版权声明:本文标题:javascript - Refresh the page after click OK on alert box - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745618826a2666561.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论