javascript - Jquery field selection -


<form>                 <div class="content-search-block">                     <div class="search-bar">                          <div class="search-bar">                          <input type="text" class="form-control" id="dname" name="dname" value="" placeholder="otsi töötajaid">                         <button type="submit" id="submit"   class="icon"><i class="fa fa-search"></i></button>                      </div>                 </div>                 </form> 

so have kind of search field. kind of start on js file.(yeah in wp) seems script doesent load on submit button?

jquery(document).ready(function(){ jquery('#submit').click(function(){ var name = jquery("#dname").val(); 

i tried

jquery(document).ready(function(){ jquery('#submit').click(function(){ var name = jquery("#dname").val(); jquery.ajax({ url: '/wp-admin/admin-ajax.php', type: 'post',   // adding post method datatype: 'json',// including ajax file data: {'action': 'do_search', 'dname':name}, // sending data dname post_word_count function. success: function(data){ // show returned data using function. alert(data); } }); }); }); 

why? script enqueued , loaded @ loading on page. still nada.

in code open 3 div tags closed 2 div tags


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -