Hi there, i’m trying to do a bit of a clean up job on some code, but can’t get the last bit working, basically i’ve got a list of equipment that’s pulled through from a database with the value of each being the id of each piece of equipment, users should be able to make multiple equipment selections to query the database. This is the code.
[CODE] var equips=””;
for(i=0;i<jQuery(“#erows”).val();i++) {
if(jQuery(“#equipment_”+i+”:checked”).val())
equips+=jQuery(“#equipment_”+i+”:checked”).val()+”;”;
}
var gdata=”erows=” + escape( equips );
It currently query’s the database successfully if a single piece of equipment is selected, however if multiple bits of equipment are selected by the user they get an error. It appears to be when escaping multiple variable selections are pulled through in the gdata var. Can anyone help where I may be going wrong with this?
Many thanks.