开发者

Firing a click event with Prototype

开发者 https://www.devze.com 2022-12-28 17:13 出处:网络
currently working on magento and managed to remove certain sections from the check out process that are not needed. Anyway the last section I want to remove is the order review so essentaly instead of

currently working on magento and managed to remove certain sections from the check out process that are not needed. Anyway the last section I want to remove is the order review so essentaly instead of Billing Address > Review > Comfirmation. I just want Billing > Comfirmation. Anyway with in JS I can do this?

My current idea is to assign a id to the finaly submit button. select element and click it once on the review stage atomatically by开发者_运维技巧 js.

at moment i modifyed the gotosection code and added.

if(orig == 'review'){
 $('reviewButton').click();
}

In prototype how do i select a element and use .click() method on it please.


You can find the element exactly as in your code:

var element = $('reviewButton');

Prototype doesn't provide any special means of firing native events on elements, but this question and answer here on SO seem to think it's fairly do-able with Javascript.


You can do it like this :

Event.simulateEvent($('reviewButton'),'click');
0

精彩评论

暂无评论...
验证码 换一张
取 消