Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

Problema com input box fucntion

$
0
0
Boas Pessoal

Tenho uma input box numa form onde geralmente insiro websites tipo ("http://www.google.com");

O problema é que quando insiro o website com "http://" antes e carrego no butão da form esta não faz nada...

O codigo é o seguinte:
Código :
         <form class="form-horizontal" role="form" method="get">
         <div class="form-group">
                 <label class="col-sm-2 control-label" for="name">SEARCH JOB</label>
                 <div class="input-group col-sm-9">
                 <input id="name" name="name" type="text" class="form-control" placeholder="Type the URL Job" />
                 <span class="input-group-btn">
                 <button type="button" class="btn btn-default btnSearch">
                         <span class="glyphicon glyphicon-search"> Search</span>
                 </button>
                 </span>
                 </div>
         </div>
         </form>


Código :
<script type="text/javascript">
         jQuery(document).ready(function($) {
         $('.btnSearch').click(function(){
         makeAjaxRequest();
         });
                 $('form').submit(function(e){
                         e.preventDefault();
                         makeAjaxRequest();
                         return false;
                 });
                 function makeAjaxRequest() {
                         $.ajax({
                                 url: 'php/search.php',
                                 type: 'get',
                                 data: {name: $('input#name').val()},
                                 success: function(response) {
                                         $('table#resultTable tbody').html(response);
                                 }
                         });
                 }
         });
</script>

Viewing all articles
Browse latest Browse all 14700

Trending Articles