mfisher86
mfisher86

Reputation: 75

Firing a click event with Prototype

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.

Upvotes: 1

Views: 7433

Answers (2)

Johann
Johann

Reputation: 1

You can do it like this :

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

Upvotes: -1

T.J. Crowder
T.J. Crowder

Reputation: 1075587

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.

Upvotes: 3

Related Questions