@ShagunMalik Can you share HTML and JavaScript for better understanding.If my assumption is correct, here you don't need a submit button . Have a normal button and on click of that button get input field value and do an AJAX call. This way user will be on same page and you can use existing variables...