0

I am using the GET method inside the form and I want to change the URL after every button click.

This is my HTML form:

 <form id="user_form" method="GET">
    <input placeholder="Search A Word" type="text"  class="txtSearch" name="ajaxData" id="ajaxData">
    <input type="submit" name="btnSubmit" id="btnSubmit" Value="Submit">
</form>

and this is my Ajax call:

$("#btnSubmit").click(function(){

    var textboxvalue = $("#ajaxData").val();

    $.ajax({
            data: {ajaxData:textboxvalue
        },
        type: "GET",
        url: 'dictionary.php',
        success: function (result)
        {
            $(".php_responce_here").html(result);
        }
    });
    return false;
});

I want to change the query string after every button click.

For example, if I write yes in the textbox, this is the query string:

http://localhost/hifzil/game.php?ajaxData=yes&btnSubmit=Submit

Though it's working, the query string is not changing while writing again and again in the textbox. How do I change the query string after every submission in the textbox?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
mod geek
  • 310
  • 2
  • 18
  • @Quentin is there any duplicate available then plz send me the url I will remove my question – mod geek Apr 16 '16 at 17:47
  • http://stackoverflow.com/questions/4664166/how-to-do-awesome-refreshless-page-changes-like-github this is the question – Jose Rojas Apr 16 '16 at 17:52
  • no i dont want to do like this – mod geek Apr 16 '16 at 17:54
  • @JoseRojas I have a format ajaxData=value of the textbox. Now I want to change the url after every value of the textbox using ajaxCall – mod geek Apr 16 '16 at 17:55
  • 1
    @modgeek — If you mean the address displayed in the address bar, then the duplicate is a duplicate. If you mean the address that Ajax request is made to, then the code in the question already does that, so it's unclear what the problem is. – Quentin Apr 16 '16 at 17:56

0 Answers0