IndianaGuy 0 Posted September 15, 2017 Report 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> Quote Link to post Share on other sites
justsomeguy 1,135 Posted September 15, 2017 Report 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. Quote Link to post Share on other sites
john_jack 7 Posted September 16, 2017 Report 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.