How to save multiple textboxs as an array.

Okay so I have this big form that has multiple textboxs.

Is there anyway to have the textboxs act like a checkbox? Meaning the value only gets to the array if the textbox is filled out?

Here’s the code I have so far concerning this (I’m not showing you guys the whole form, just the part I need help with.)

[php]

[/php]

On the next page I’m trying to take the post variables but some reason It wont let me.

[php]

<?php $description = $_POST["desc"]; echo $description[0]; ?>

[/php]

I’m just trying to echo the value right now, Later I’m going to put the values in an email. possibly using foreach.

But can anyone help me by getting the textbox variables right?

The value would be $_POST[‘desc’][0] (or 1 or 2 or 3);

You would receive values for all, but you could check the values:

[code]
foreach($_POST[‘desc’] as $d) {
if($d != ‘’)
}

But this does not guarantee that they could not all be filled in.
You could have a radio for what the type of description , and one description field.[/code]

Sponsor our Newsletter | Privacy Policy | Terms of Service