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
Asked
Active
Viewed 60 times
-4
-
6so....use ajax? – Manav Sep 20 '17 at 10:39
-
You can use `$_SESSION` – Salim Ibrohimi Sep 20 '17 at 10:54
-
Don't think php is the right way. Why you don't use JS/jaax as Manav told you – Oswald Sep 20 '17 at 11:00
1 Answers
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