can you people please help me out ?
Sure. Get rid of the java scripting crap. Use JUST standard HTML form items, including items of type SUBMIT.
Have two text boxes and a submit button on the same form. When you do, and you have an appropriate method, the GET request that is generated will NOT be the same when the form is first requested and when the submit button is pressed.
Actually paying attention to the complete GET request will be necessary.