IndianaGuy Posted September 15, 2017 Share Posted September 15, 2017 I am new at this and playing around right now to learn JQuery. I am am thankfull for resources and advice you might give. I am sending a request to a file and I want the returned results to be entered in a disabled input box <script> $(document).ready(function(){ $("#req_btn").click(function(){ $("#myResults").load("get_results.php"); }); }); </script> Outcome: <input type="text" id="myResults" name="myResults" disabled> Link to comment Share on other sites More sharing options...
justsomeguy Posted September 15, 2017 Share Posted September 15, 2017 I don't think that the load method is a general-purpose thing that will know how you want to use the returned data, I think it's just for updating the HTML inside an element. An input element does not contain HTML, so I don't think that's going to work. Send a regular ajax request, get the response, and then you can use the input element's value property to change the value in the field. Link to comment Share on other sites More sharing options...
john_jack Posted September 16, 2017 Share Posted September 16, 2017 I believe this is what you are trying to achieve https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_ajax_post sending and receiving Data. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now