Subject RE: [firebird-php] Tick Boxes on web page
Author Alan McDonald
Hi
http://www.abbanis.com
On Businesses For Sale page
I would like the public to be able to browse that page and to say
double-click on a row, or in another way, put a tick in a tick box, to be
able to select one or more businesses for sale like this, then click a send
button to send an e-mail with all these Ref No's contained in the body of
the e-mail, etc.
How do I do this?
Using Fusion, Dreamweaver, Firebird, PHP.

Thx

----------------------------
Johan van Zyl
I can't get this url but here's what I do to achieve this in the backend -
you can get the same thing done using clientside javascript:
there a a few things to do to achieve this
1. have a field in a grid - checkbox of name array
e.g.
<input type='checkbox' name='cbrecon[]' value=pkvalue [checked] >
notice the name if cbrecon[] - it's an array
this is so you can have it multiple times on the one page and still get to
it later.

2. when you submit the form you need to do something like this
if (($_POST['saverecflags']=="ok")) {
foreach ($_POST as $fieldName=>$fieldValue) {
if (gettype($fieldValue) == 'array') {
$iCount = count($_POST[$fieldName]);
for ($i=0;$i<$iCount;$i++) {
$fieldValue = $_POST[$fieldName][$i];
if ($fieldName=='cbrecon') {
$db->get_var("UPDATE MYTABLE SET FIELD1=value WHERE
MYPK.ID=".$fieldValue);
}
}
}
}
}

this way you can process the page containing multiple checkboxes using the
checkbox value to locate the associated record.

Alan


[Non-text portions of this message have been removed]