javascript - How is user input submitted in bootstrap 3 form? -


i'm using bootstrap 3, includes jquery 1.11.2.min.js. i'm updating search webpage 2 textfields: keyword , city,state,zip. have script search results needs pull user input that's typed these 2 search textfields finding desired search results.

visual explanation: search bar placeholders , search button: enter image description here

my search bar user input (searching engineering job in boston): enter image description here in html, there no unique value (value="engineer" or value="boston") created engineering job in boston search: enter image description here

without value="engineer" , value="boston" cannot tell script display search results of engineering jobs in boston. find/create pull search script?

is located in bootstrap.js file anywhere? i'm having trouble figuring out where/how form pulling user input value (without having use value="" each input).

your appreciated - form below.

<div id="somebanner" class="somebanner-bgsearch-red hero1 hidden-xs">   <div class="container-fluid">     <div class="top-section">         <div class="container">           <form class="form-inline no-margin center-block" action="http://www.somesite.com/unknown" method="post" role="form">             <div class="row">               <center>               <fieldset>                  <!-- search input-->                 <div class="form-group center-block">                   <div class="col-sm-4">                     <input id="keyword" name="keyword" type="search" placeholder="keyword" class="form-control input-lg">                    </div>                 </div>                  <!-- search input-->                 <div class="form-group center-block">                   <div class="col-sm-4">                     <input id="location" name="location" type="search" placeholder="city, state, or zip code" class="form-control input-lg">                    </div>                 </div>                  <input type="hidden" name="unknown" value="unknown">                  <!-- button -->                 <div class="form-group center-block">                   <div class="col-sm-2">                     <button type="submit" id="btn-search" name="btn-search" class="btn btn-primary btn-lg btn-tusaj">search</button>                   </div>                 </div>                 </center>               </fieldset>             </div>           </form>         </div>       </div>     </div>   </div> 

here's link bootstrap.js code: http://getbootstrap.com/dist/js/bootstrap.js

herer's link jquery code: https://code.jquery.com/jquery-1.11.2.js

enter image description here

you're trying use bootstrap modifying html, bootstrap css framework used responsive design. it's incapable of doing such html modification. need use jquery:

$(document).ready(function(){   $("#btn-search").click(function(e){     e.preventdefault();     var x = $("#keyword").val();     var y = $("#location").val();     $("#keyword").attr("value", x);     $("#location").attr("value", y);   }); }); 

that should work. if have further questions, let me know in comments.


Comments