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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745618827a4636396.html
评论列表(0条)