HI!
Somebody must've done this before, so I'm probably making unnecessary work for myself.
Overview - Allow user to update multiple email addresses using textarea form objects to display each array element from an exploded delimited string.
Technical APproach - 'n' number (dependent upon count of array from an explode() ) of textareas are spawned by PHP on the fly in a form. Each are given an alphanumeric name (email1, email2 etc) and populated with the contents of each array index.
function doTxtareaList($delimitedStr){
$this->StrArray = explode($this->delimiter,$delimitedStr);
$this->StrArrayLen = count($this->StrArray);
$TxtareaList .="<table>";
while(list($index,$content) = each($this->StrArray))
{
$this->newIndex = $index+1;
$TxtareaList .= "<tr><td> <input type=\"text\" name=\"$this->ElementName$this->newIndex\" value=\"$content\"></td></tr> ";
}
$TxtareaList .="<input type=\"hidden\" name=\"StrArrayLen\" value=\"$this->StrArrayLen\"/></table>";
return $TxtareaList;
}
I want to submit the form using PHP_SELF as action. I need to count the number of form objects - not a problem as this comes from the array from above class function- and then implode them into a delimited string for updating the one field in a mysql db.
Problem - THe last bit - putting the email1, email2, etc into an array in preparation for an impode(). How and when do i do it? When action=php_self, the class variables are forgotten right, so how about onSubmit - would that capture modified input from user before page is refreshed.
Hopefully this has been done B4.
Rgds
Malcolm