【发布时间】:2014-03-24 13:43:10
【问题描述】:
我做了这个表格来计算运费:
<div class="container-frete">
<div class="title-frete">
Simulação de Entrega:<br>
<div class="label-frete"> Digite seu CEP<br> </div>
<input id="cep" type="text"/>
<input id="botao" type="button" class="button-frete" value="<?php echo $this->__('Calcular'); ?>"/>
</div>
<div id="content-frete">
</div>
但我不知道如何让 enter 按键起作用:
<script>
Event.observe('botao', 'click', function(event) {
new Ajax.Updater('content-frete', '/Freteproduto?cep='+$('cep').getValue()+'&productid=<?php echo $produto->getId();?>', { method: 'get' });
});
</script>
【问题讨论】:
-
检查这可能会有所帮助stackoverflow.com/questions/1231327/…
-
你在使用prototype吗?如果是这样,您是否链接了脚本
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1/prototype.js">? -
是的,它在点击时链接了它的工作,但是当我按下回车键时我需要这个
标签: javascript keypress enter