I have the files test.html, test.js and test.php in my directory. I am trying to send some data to my backend, which should be dealt with by test.php. I run my server using PHP’s built-in webserver with the command php -S 0.0.0.0:8080 -t test-server/. Here’s a simplified demonstration, whenever I click “submit”, it should send the data to my php
Tag: ajax
How to keep the Input field inside the session storage and disabled upon refresh?
I want to disable the input field after the user clicks the “disable” button, and automatically change the “disable” button to “enable”, disabling the input fields at the same time. But, if we refresh or press Ctrl+F5, the disabled fields becomes enabled and editable. Below is the code I have, what should I do to keep it disabled even upon
SyntaxError: Unexpected token ‘o’, “object(Sim”… is not valid JSON
The purpose of the following code is to go through xml file and see if email or login entered by user are taken, and I want to get a JSON response. Here’s my AJAX code: And here’s ‘create_user.php’: Answer It seems you have not prevent PHP code from writing multiple JSON data. In your code you are first checking for
How do I filter with dropdown list? PHP and SQL
We are trying to filter based on the tags or the dropdown menu, we are trying to create a blog website that has tags and those tags can be used to filter the posted content on the homepage Tags dropdown menu:. Here should be the content in the page: Here should be the content in the page: Answer Set tags
Passing 2 parameters in ajax url in Laravel route
I need help, my ajax request doesn’t work if i use 2 parameters in url but if i only use 1 parameter it works perfectly fine. There isn’t error in the first one but i think it does not reach to the controller because the output in response is undefined. this is my view this is my ajax request when
What could be wrong with this request in AJAX and PHP?
I’m trying to call a PHP page passing parameters with AJAX. I can see that the page is called, but the $_REQUEST doesn’t take any parameters. If anyone can help me, I’d appreciate it. Thanks! My AJAX is that: In the PHP Page, I have this. Always the answer is failure. Thank you! Answer 1- change your data format in
I use ajax to send data but cannot receive data back from php file [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 4 months ago. Improve this question
Submit and POST “True” or “False” to a series of text questions presented one by one taken from a php array
new to forum, AJAX and JQuery. A little experience of PHP and JS. I’m trying to present a long series of questions (400+) one by one in an input text field on a form with 2 submit buttons labelled “True” and “False”. I need one question to be presented at a time, then record the True or False result as
Why AJAX dont´t pass value of name from html File-(JS part) to PHP File using POST?
I tried to pass value of name from .js file to PHP using POST method. But when I start the code, there isn´t any alert. In console is only: Uncaught ReferenceError: $ is not defined Do you know what could be improved? Answer As a simple, single page, test script that will send a POST request to the server which
Content of ckeditor textarea is not sent through Ajax Jquery
I have a form with inputs and a textarea (ckeditor), after submitting the form with ajax all input fields value are sent to database table except CKEDITOR textarea and I can’t figure out why! I’ve tried some solutions in some questions here with same problem but with no vein! HTML PART JS PART Answer It’s not working because the value