Reputation: 575
i have sent values of form fields are sent using val().. i want to send plain php variables to via ajax, this is id values
var dminute= $("#dminute").val();
var dataString = 'dminute='+ dminute + '&dhour=' + dhour + '&minuteid1=' + minuteid1+ '&hourid1=' + hourid1+ '&datepicker=' + datepicker;
for php variable, how should i send?
var dminute=$dminute;
is a wrong syntax.. If someone would, tell how to send this..Thanks in advances..
Upvotes: 0
Views: 59
Reputation: 36551
you can use php tags.. if your codes in not in seperate .js file
try this
var dminute= <?php echo $dminute ?>;
Upvotes: 1
Reputation: 2558
If you want to assign your php variable to javascript var,
var dminute= <?php echo $dminute;?>;
Upvotes: 1