Magento - Javascript: update form from user's choice
So my question is, is there something I can use? Which method and how can I trigger it?
I'm gonna review onepage checkout's code in order to see if it makes things clearer, but if you know another form that has this behaviour please let开发者_开发问答 me know. Also, I know how I could write such code in plain javascript, but I'd rather use the magento way, in order to learn.Cheers
The Javascript code doing is defined in [skin]/js/opcheckout.js
. The Payment class defined there is made solely for the credit card checkout form.
You can study what they did and do something similar - or just write the show/hide code yourself. I'd suggest the latter if you don't have an insane amount of programmic logic - otherwise wrap it in a class.
精彩评论