I have a dynamically created checkbox and I want to pass the values of the checked boxes.I dont want to use an array because it interferes with my other function

Member Avatar for diafol

Not much to go on seffu. Because you're producing a checkbox that must be able to be uniquely identified somehow, either you supply an array, e.g. name="mycheck[]" or a custom name="skwRjrbnln" (something random from a generator) or you can create a 'hybrid' name="mycheck[dkwv]". In addition, you could keep trac of the number of instances of the checkbox,e.g. with 'index' and set that as: name="mycheck[4]" etc.

I'm assuming that you are passing data to the server, so does the server need to be able to identify which checkbox is which? I know you said no arrays, but I'm struggling to see what you're trying to do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.