Page 1 of 1

How do I find Prod Title Id

Posted: Wed Aug 01, 2012 10:35 pm
by khalidhabib.cs
here is my Code I want Create a function which take element id dynamically

function otherCatChargs(qty,prodTitle){


var quantity=document.getElementById(qty).value;
var proTitle=document.getElementById(prodTitle).innerHTML;
var service_charges=175;
var concert_tckt_service=150;

and here is code where i calling it

<td class="product-title" id="product-title<?php echo $counter;?>"><?php echo $d[$i];?></td><input type="hidden" name="p_name<?php echo $counter;?>" id="prd_name" value="<?php echo $d[$i];?>" />
<input type="hidden" name="item_id<?php echo $counter;?>" value="<?php echo $row['item_id'];?>"/>
<td class="num-pallets"><input type="text" class="num-pallets-input" name="product_qty<?php echo $counter; ?>" id="turface-mvp-num-pallets<?php echo $counter; ?>" onkeyup="otherCatChargs(this.id)"/></td>

How I find It of product-title class ..

Re: How do I find Prod Title Id

Posted: Thu Aug 02, 2012 7:21 am
by social_experiment
You could use getElementsByClassName() but it's not supported by IE8 and earlier; take a look at this url, might be helpful.
http://robertnyman.com/2005/11/07/the-u ... classname/

Re: How do I find Prod Title Id

Posted: Fri Aug 03, 2012 5:21 am
by khalidhabib.cs
Thank You Boss :*