1

I have dynamicaly created table with products:

detail      qty    price     total
detail1     3      23        69
detail2     1      3         3

Qty is in text input field. every qty text field name is unique detail code. I need that every time i change qty field, it updates session array with that unigue detail code.
How can i do this over jquery without submitting form?

Sorry for my bad english, omerimuni

3 Answers 3

0

This code has been taken (and modified slightly) from another answer - but it should solve your problem. Try this -

$('input:text[id*="qty"]').bind('keyup',function() {
    $.post("my_other_script.php", { qty: this.id} );
}); 

'my_other_script.php' would then be -

<?php $_SESSION['qty'] = $_POST['qty']; ?>
Sign up to request clarification or add additional context in comments.

1 Comment

I have id="itemid_32423434_qty". how can i determine which qty id is changed? omerimuni
0

You should use jQuery's ajax and focusout

http://api.jquery.com/focusout/

http://api.jquery.com/jQuery.ajax/

User changes qty. Upon leaving that textbox, send ajax request to update your session variable.

Comments

0

Create a server side service with your prefered Server side techno. This service will take your request and put the value you passed in your http Session.

Then use the Ajax module of JQuery to post you request to the service you just created.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.