I have a form that I want to default to calling a javascript ajax function to get the output. If the user doesn't have javascript enabled, I need to be able to recognize that and change the form action to a php page. Any idea on how to do this?
<form class="form-inline" role="form" action="javascript:search();">
<div class="form-group">
<label class="sr-only" for="search">Search</label>
<input type="text" class="form-control" id="search" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">Search</button>
</form>
search() will get the form input and get the output through ajax without reloading the page. If javascript is not enabled, I will need to change the action to just search.php.