This sh*t is such a pain in the a*s, I'm f*cking tired of trying to do this. In normal Jquery this is just easy, JQuery Mobile is Shit. It seems to have everything but everything goes wrong.
I tried to do the thing that you said by this way:
- <script>
- $(document).ready(function(){
- $("#homeSearch").submit(function(hola) {
- hola.preventDefault();
- $("#results").load("search.php", {buscar: $("#buscar").val()});
- alert('Form was submitted');
- return false;
- });
- });
- </script>
- <form id="homeSearch">
- <label for="buscar">Introduzca su búsqueda:</label>
- <input type="search" name="buscar" id="buscar" value="" placeholder="Buscar Música" />
- </form>
- <div id="results">
- </div>
The .preventDefault should stop submitting the form, but it didn't work, so I tried adding Return false; didn't work neither. it shows me the alert but then the page submits the form and goes to index.php?buscar=the%20thing%20that%20you%20are%20Looking%20For
Don't know what the F*ck is wrong, this works fine in another page without Jquery Mobile, but here it really SuckS!
Please HELP!