Jump to content

Checkbox Number


Jiblob

Recommended Posts

Hello,

 

I have a set of checkboxes: -

 

<form post="<?php $_SERVER['PHP_SELF']; ?>" action="post">
Option 1<input type="checkbox" name="fruit[]" value="pear">
Option 2<input type="checkbox" name="fruit[]" value="apple">
Option 3<input type="checkbox" name="fruit[]" value="grape">
Option 4<input type="checkbox" name="fruit[]" value="orange">
Option 5<input type="checkbox" name="fruit[]" value="tomato">
</form>

 

How can I extract the numbers of them all in relation to the checkboxes. EG. Grape, (Option) 1

 

I want to be able to automatically number them without the need for naming them all individually (EG. name="fruit_apple") because I want to allow for unlimited numbers of them.

 

Thanks,

 

- Luke 8)

Link to comment
https://forums.phpfreaks.com/topic/42432-checkbox-number/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.