I don’t know anything about ajax but i need solution.I would appreciate it if someone knowledgeable could help.I’m trying call php page by selection.Everything working well but except last result.This is uncertain number selection field.Its can be 3-4 selection fields or 10 selection fields with options.Page working by oneself but i can’t show that result in target page using ajax.I should post catid and get the result of get-values.php inside of .Someone can help me ?
I’m trying the code below with .load() and .html() but its not working.
function GetCatVal(val) {
$.ajax({
type: "POST",
url: "./php/get-values.php",
data:'catid='+val,
success: function(data){
HELLPPPPPP sounds are getting louder from this area
});
}
2
Answers
Actually problem is only select> tag.Code page working by oneself but i cant show result inside of div> tag.
php file
-----------------Codes for Collecting Data from API------------------
---After to other selections i should show category attribute names and values.First loop for gather attribute names.This loop creating tags.Inside of this loop i have secondary loop for gather attribute values.Below echo giving that result to me as fine.-----
script
If i try change some php code for show results inside of select tag its working fine.I can show result to select id="katvallist"> with only creating options> in php codes. but i cant show any data inside of div id="katvallist"> tag.
would be nice to get more information where your code fails: in PHP or in ajax, do your get data in PHP or don’t even reach PHP code. Did you checked are you getting your
'catid='+val
value in PHP code? I would recommendconsole.log(data)
insuccess
function.var_dump($_POST);
F12 -> network -> find your get-values.php
Also i would suggest:
var param = "catid"+val
data: {catid: param}
Then in PHP you will get
$_POST['catid']