Skip to content

Tag: javascript

Calling a php variable in JS does not work

I’m trying to make a user input by reading the contents of my server directory with php. So the user can select a file, in my case a CSV file which gets saved into a variable and then gets processed further down in my JavaScript code that should make a chart from it. All it does now is output the

Prevent truncating of preceeding zeros in Javascript

I am trying to pass variable to a JavaScript function that then makes an Ajax request using the variable. My problem is that if the value of the variable starts with zeros, the zeros are truncated. For example, if the value is 00056, what is sent for an Ajax call is 56 Here is what I am doing How do

Cant seem to get the first dependency to run on AJAX call

I am having significant issues trying to get the AJAX to fire on this PHP code. I can get the first field populated without issue, however the AJAX call does not seem to populate the first dependency (and therefore the second). I am an AJAX newbie (and have googled extensively) but cannot seem to crack this o…

Ajax request to php with empty POST data

I am new to javascript and I have problem with an ajax POST to php. I am trying tosend javascript variables to php via an ajax POST but it doesn’t work. The ajax post is sent but it sends empty POST. I got alert “Error occured ! 202” when trying to save data to bdd. Thanks in advance for hel…

How to call PHP function using Ajax (Javascript, PHP and Yii1.1)

I am looking to call a PHP function through an onclick event. The PHP action within the controller then should start a download for a json File containing the needed data. I already know ajax and I am using it currently but somehow the function does not fire. I am 100% certain that I am doing something wrong,…

Laravel destroy nested resource

I have a resource name OrganizationEmailDomain and able to index it just fine In that view, when clicking in the three dots there’s the destroy part If in that index view I echo $email_domains (<?php echo $email_domains;?>) then I get as expected (note that the following was before the images were…