I cannot seem to figure this out. You can view an example of what I've done so far here: http://jsfiddle.net/aCUQC/1/
When a user does a search, an 'x' will appear. Click the 'x' to submit the form.
I am able to 'submit' the form; however, I cannot get it to read the input text value!
The HTML is as followed:
<link rel="stylesheet" href="//code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css">
<script src="//code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<br />
<br />
<div data-role="collapsible" data-collapsed="false" data-mini="true" data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d" data-theme="x">
<form method="GET" action="search.do" data-ajax="false" style="height: 40px;" id="smartSearch">
<input data-inline="true" type="text" data-type="search" data-corners="false" name="q" placeholder="Type Name Here (e.g. John Smith)" data-mini="true" autocomplete="off" />
</form>
</div>
The JS:
$('#smartSearch').on('click', '.ui-input-clear', function (e) {
e.preventDefault(); // prevent the link's default behaviour
$('form#smartSearch').submit();
});
Your help is appreciated! Thanks!