how to get value in text field

Posted by air on Stack Overflow See other posts from Stack Overflow or by air
Published on 2010-04-23T17:45:24Z Indexed on 2010/04/23 17:53 UTC
Read the original article Hit count: 199

Filed under:
|
|

i have one text field and setting its name & values from php

like
          <input type="text" id="qtyProductID_' . $productID . '" size="3" value="' . $totalItems . '" >

i also have image button for click event

         <a href=fun.php?action=update&productID=' . $productID . ' onClick="return false;"><img src="images/update.jpg" id="updateProductID_' . $productID . '"></a>

now after click in JS file i want to get value of text field i click

            var productIDValSplitter    = (this.id).split("_");
    var productIDVal            = productIDValSplitter[1];  
            var tqty     = $('#qtyProductID_'.productIDVal[1]).attr('value');   
    alert(tqty); 

i am getting error

i am looking for how to set the variable name in

         $('#qtyProductID_'.productIDVal[1])

Thanks

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about php