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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table of checkboxes in a PEAR quickform

Status
Not open for further replies.

JediDan

Programmer
May 15, 2002
128
0
0
US
OK, this one is complicated.

I am building a series of pages with the PEAR quickform_controller framework. On my second of two pages, I want to display two checkboxes each for every row of an array passed from the first page (this, by itself, works fine).

At the end of all this, I want to be able to tell which of those checkboxes the user clicked, and so I need to put them into the form. However, I would like to retain the layout where the user sees the data from the array in the first column, and one checkbox in each of the next two columns vs. having them just in a list down the page.

If anyone has any thoughts on this, I'd appreciate receiving them!

Thanks,

Dan
 
haven't quite followed you. could you post a mock-up of what you are trying to achieve?
 
Imagine you have the table below:
Code:
<table>
<th>Item #</th>
<th>Option 1</th>
<th>Option 2</th>
<tr>
<td>Item 1</td>
<td><input type="checkbox" name="op1" /></td>
<td><input type="checkbox" name="op2" /></td>
</tr>
<tr>
<td>Item 2</td>
<td><input type="checkbox" name="op1" /></td>
<td><input type="checkbox" name="op2" /></td>
</tr>
</table>

...but I want the check boxes to be part of the form not just "out there" in a table. In regular HTML, this wouldn't be too hard, but because I'm building the form in a PEAR page, the checkboxes are built in code and I can't figure out how to get them to be part of the form.

Hope this is clearer, it's a tricky problem.

Thanks
 
i'll take a look at quickform but for most form building classes you just assign the checkbox to the form! ie

Code:
$form = new Form;
$checkbox=$form->addcheckbox();
$checkbox->addproperty(propertyname, propertyvalue);

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top