I have one input-text box with a submit button. By using an autocomplete method when I search for related data, if data is in database it should do the search, otherwise it should be inserted in database when I click submit. Here in my code I am getting the database result in "source" using ajax in JS.I have one input-text box with a submit button.