We help IT Professionals succeed at work.

auto update textbox

Is there a way in jquery to auto update a text box the same way you use
__doPostBack('UpdatePanel1', '');
I am using onkeyup and onkeydown all the javascript functions but I need a way to update the text box as soon as a user keyup without disrupting my javascript function onkeyup.

I tried to start.
$('input[id^="txtquantity"]').each(function() {
    $('#txtquantity').blur(function() {
    $('#txtquantity').change();
    });
});

I am currently using
 $('input[id^="txtquantity"]').each(function() {
            $(this).keyup(function() {
for a popup.

I will take any idea on to auto update or postback in jquery.
Comment
Watch Question

Seven priceFull Stack

Author

Commented:
I will like to use the .change( [eventData], handler(eventObject) )
Top Expert 2011
Commented:
Are you trying to do two things at once after the keyup (launch a popup and your autoupdate)?
Could you not do both, sequentially?

 $('input[id^="txtquantity"]').each(function() {
            $(this).keyup(function() {
              //call/run your JS popup function/routine
              //call/run your autoupdate function/routine
            );}
 );}

Open in new window

Seven priceFull Stack

Author

Commented:
Problem is when I run __doPostBack('UpdatePanel1', ''); anywhere then my popup stop working, any reason why?
Top Expert 2011

Commented:
I''m not an expert in postbacks, but my understanding is that when you do the postback, the page literally posts itself back to the server and displays/processes/updates accordingly.  When that happens, your onkeyup event no longer exists because the state of page is not the same.

If you are launching a popup, can you launch the popup first the do the postback?
Or are you saying you have a popup that interacts with the webpage, and when the postback happens the functionality of the popup stops?
Seven priceFull Stack

Author

Commented:
Sorry my friend this is not a popup, this is a programatic table with text boxes for quantity. but thanks
Seven priceFull Stack

Author

Commented:
do you know if i can use a text box to click a button onkeydown or mouse up.?
Seven priceFull Stack

Author

Commented:
tks