Hi I've multiple criteria of checkboxes on one page. Each criteria contains
differnt number of checkboxes. I've 8 criterias of checkboxes. 
For example
<div class="refSearchCuisineForm">
<div><input type="checkbox" >A</div>
<div><input type="checkbox" >B</div>
<div><input type="checkbox" >C</div>
</div>
<div class="refSearchEntreeForm">
<div><input type="checkbox" >A1</div>
<div><input type="checkbox" >B1</div>
<div><input type="checkbox" >C1</div>
<div><input type="checkbox" >D1</div>
<div><input type="checkbox" >E1</div>
</div>
etc...

All I'm trying to do is create objects for each criteria of checkboxes like
mentioned below on page load

var $cuisineCheckBoxObject = $(".refSearchCuisineForm
[EMAIL PROTECTED]'checkbox']");
     cuisineCheckBoxObject=$cuisineCheckBoxObject[0];
    var $entreeCheckBoxObject = $(".refSearchEntreeForm
[EMAIL PROTECTED]'checkbox']");  
    entreeCheckBoxObject=$entreeCheckBoxObject[0];
    var $neighborhoodCheckBoxObject = $(".refSearchNeighborhoodForm
[EMAIL PROTECTED]'checkbox']");
    neighborhoodCheckBoxObject=$neighborhoodCheckBoxObject[0];
    var $openForCheckBoxObject = $(".refSearchOpenForForm
[EMAIL PROTECTED]'checkbox']");
    openForCheckBoxObject=$openForCheckBoxObject[0];
    var $restTypeCheckBoxObject = $(".refSearchRestTypeForm
[EMAIL PROTECTED]'checkbox']");
    restTypeCheckBoxObject=$restTypeCheckBoxObject[0];
    var $restFeaturesCheckBoxObject = $(".refSearchRestFeaturesForm
[EMAIL PROTECTED]'checkbox']");
    restFeaturesCheckBoxObject=$restFeaturesCheckBoxObject[0];
    var $barTypeCheckBoxObject = $(".refSearchBarTypeForm
[EMAIL PROTECTED]'checkbox']");
    barTypeCheckBoxObject=$barTypeCheckBoxObject[0];
    var $barFeaturesCheckBoxObject = $(".refSearchBarFeaturesForm
[EMAIL PROTECTED]'checkbox']");
    barFeaturesCheckBoxObject=$barFeaturesCheckBoxObject[0];


Annoyingly this initialition is taking 4-5 secs... I think I'm not doing is
in efficient way..I want to take this initialization to below 1 sec..  Is
that possible.. Please reply to this ASAP..
Thanks in advance.

Regards,
Vijay Potluri



-- 
View this message in context: 
http://www.nabble.com/Effiecint-way-to-create-an-object-for-checkboxes-onload-tf4483982s15494.html#a12786808
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to