KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How do I properly load the a certain value into a textbox using jQuery? Tried the one below but I get the [object Object] as output. Please enlighten me on this, I'm new to jQuery. proc = function(x, y) { var str1 = $('#pid').value; var str2 = $('#qtytobuy').value; var str3 = $('#subtotal').load('compz.php?prodid=' + x + '&qbuys=' + y); $('#subtotal').val(str3); } <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <form name="yoh" method="get"> Product id: <input type="text" name="pid" value=""><br/> Quantity to buy:<input type="text" name="qtytobuy" value="" onkeyup="proc(document.yoh.pid.value, this.value);"></br> Subtotal:<input type="text" name="subtotal" id="subtotal" value=""></br> <div id="compz"></div> </form>
Tags (comma-separated)
Save Edits
Cancel