Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox values in arrays

Status
Not open for further replies.

daph

Programmer
Jun 9, 2000
65
CA
Hi,

Is there a way to pass some kind of null value when a checkbox isn't checked? The reason why I'm asking is because I have a list of checkboxes that will be saved in an array in PLSQL. If there are three checkboxes and the second one hasn't been checked, I still need the values to be in the right order in the array.

Ex: checkbox1 in array[1]
checkbox2 in array[2]
checkbox3 in array[3]

Right now, if checkbox 2 isn't checked I get
checkbox1 in array[1]
checkbox3 in array[2]

I hope you guys understand what I mean.

Thanks for your help!

daph
 
I don't think there's any way to get checkboxes to return a value if they are unchecked - the browser will only return one if they are checked.

Am I right in thinking that you've given all your checkboxes the same name, and are getting their values back in an owa_util.ident_arr? Then you want to check if the second one's checked by checking if checkboxes[2]='Y'.

You can't do it that way. What you need to do is give each checkbox a different value then loop through the array searching for that value. If you wanted to, you could begin by looping through and populating a second array laid out as you originally wanted.

Hopefully that gives you some idea of which way to go, if not, post a little more details of what you're doing and I'll have another go. -- Chris Hunt
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top