-4

i have used car selling site. users can post their car for sale. I want users should be able to see the expected price of their car when they click on expected price field without submitting the from. function input is to be passed as variable. Se below image

enter image description here

user223321
  • 155
  • 1
  • 15
Swati
  • 23
  • 1
  • 7

1 Answers1

1

Search for ajax. For example (with jQuery)

$.ajax({ url: "website.com/phpfile.php?var=" + encodeURIComponent(value),
    cache: false,
    timeout: 10000,
    success: function(response)
    {
         // do something with the result, or omit the whole success if not needed
    },
    error: function(jqXHR, textStatus, errorThrown)
    {
         // notify user about error?
    }
});

There are easier, more oriented versions, like $.post or $.get Check out here: http://api.jquery.com/category/ajax/

YaniMan
  • 293
  • 2
  • 13