【发布时间】:2017-07-28 10:06:04
【问题描述】:
当我按下搜索按钮时,我的 JS 代码将起作用。 但是当我使用 enter 提交表单时,波纹管代码将不起作用。 在magento中使用代码。 HTML
<form action="<?php echo $this->getUrl('storelocator/index/searchbydistance') ?>" method="GET" id="search_by_distance">
<button type="button" onclick="storeSearch.submit(this)"><?php echo $this->__('Search') ?></button></form>
Javascript
<script type="text/javascript">
//<![CDATA[
storeSearch.submit = function(button, url) {
alert('hi');
}.bind(storeSearch);
//]]>
【问题讨论】:
标签: javascript jquery prototype magento-1.9