Connecting Tech Pros Worldwide Forums | Help | Site Map

Grabbing a custom attribute from a checkbox element

Newbie
 
Join Date: Aug 2007
Posts: 24
#1: Sep 3 '07
have a page with lotsa checkboxes, am using javascript to count the number of boxes checked and to total the prices for all boxes checked. would like to pass the "description" of each checkbox but cant get the code to trap this field.

here's what the checkbox looks like ...

Expand|Select|Wrap|Line Numbers
  1.  
  2. <input type="checkbox" name="C02074" id="C02074" value=1 descrip="size, color, number,  etc,  @73.60" item="02074" price="73.60" yes="yes" onclick="totalCheckboxes(this);" readonly>
  3.  
  4.  
we're using name, id, price in our calculations. how can I trap descrip and use to populate an order field?

pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#2: Sep 4 '07

re: Grabbing a custom attribute from a checkbox element


Changed thread title to better describe the problem.

Heya, TX.

Have a look at Element::getAttribute().
Reply