javascript - Enter keypress function in Form doesn't work -


i did form calculate shippings:

<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> 

but don't know how make enter keypress work on it:

<script>    event.observe('botao', 'click', function(event) {       new ajax.updater('content-frete', '/freteproduto?cep='+$('cep').getvalue()+'&productid=<?php echo $produto->getid();?>', { method: 'get' });    });  </script> 

i make new 1 in jquery

    jquery.noconflict(); // inside input "cep"  if (jquery('input#cep').length) {      jquery('input#cep').click(function(){ // keypress "e"         jquery(document).keypress(function(e) {              var keycode = (e.keycode ? e.keycode : e.which); // enter?              if(keycode == '13') {                  new ajax.updater('content-frete', '/freteproduto?cep='+$('cep').getvalue()+'&productid=<?php echo $produto->getid();?>', { method: 'get' });             }          });      });  } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -