jQuery .get(), submitting values in/out of form
I am trying to submit a bid to my php system using a get request ".get()".
I've been trying to interpret the documentation, and I feel like I have
most of the steps correct.
Regardless, here is my html:
<div id="1001AIE0322921TTGOD" class="item">
<input name="userbid" type="input" value="19.95"/>
<input name="email-id" type="hidden" value="whatever@iwin.com" />
<input type="button" class="submit-button" value="click"/>
</div>
And here is my javascript:
$(document).ready(function(){
var email = $("input[name=email]").val();
var item = $('div').attr('id');
var bid = $("input[name=userbid]").val();
$('.submit-button').click(function(){
$.get(
"http://qwicksale.com/classes/insertbid.php",
{
item-id: item,
email-id: email,
userbid: bid
}
);
});
});
Obviously my expected outcome is to be able to post the bid to the back
end. I would use the form.serialize() thing, but I'm retrieving my item
data from the id of the div.
Any help is appreciated.
No comments:
Post a Comment