I have a partial with the below code:
<%= form_for :subString_typed, :controller => "deployment_group", :remote=> true, :method => "get", :url => {:action => "show_workflow_list"}, :html => {:id => "subString_form"} do |f| %>
<%= f.label :Substring %> <%= f.text_field :subString, :onkeyup => "show_alert()" %>
<%end%>
and down below in the same form, I wrote the javascript function for show_alert() like this:
<script type="text/javascript">
function show_alert()
{
$('#subString_typed_subString').change(function(){$('#subString_form').submit();});
}
</script>
Will the above code submit the substring form when I type in a letter in the substring text field?
It does not work for me. Is my jQuery code wrong? My id’s are correct in the jQuery code, however I think I am using the wrong function .change() for the text field.
Please help
Are you wanting the form to submit when you keyup? Why not just call $(‘#subString_form’).submit() without the change() function