PHP Classes

How to add a drop-down field

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  Upcoming Visual HTML ...  >  All threads  >  How to add a drop-down field  >  (Un) Subscribe thread alerts  
Subject:How to add a drop-down field
Summary:How to add a drop-down to subscriptionclass.php sample
Messages:2
Author:Joe Johnson
Date:2007-04-19 16:30:16
Update:2007-04-19 19:49:53
 

  1. How to add a drop-down field   Reply   Report abuse  
Picture of Joe Johnson Joe Johnson - 2007-04-19 16:30:16
I'm very new to PHP.

I am thrilled at using Manuel's classes for my forms.

I know rudimentary code such as how to put a drop-down field in a form.

I am having difficulties adding the following code to the samples I downloaded and cloned from Manuel's Forms classes.

I want to change this code:

$this->paged_form_object->AddDataPart("<TR>\n<TH ALIGN=right>Facility ID:</TH><TD NOWRAP>");
$this->paged_form_object->AddInputPart("fac_id");
if(IsSet($this->verify["fac_id"]))
$this->paged_form_object->AddDataPart("&nbsp;".$this->verify_field_mark);
$this->paged_form_object->AddDataPart("</TD>\n</TR>\n");

to this:

$this->paged_form_object->AddDataPart("<TR>n<TH ALIGN=right>Facility ID:</TH>
<td nowrap>
<select name="fac_id" id="fac_id" size="1">
<option value="pick" selected="selected">Pick a Facility</option>
<option value="000581">Rehab Hosp SNM</option>
<option value="000582">South TX Rehab</option>
<option value="000583">North Colorado Rehab</option>
<option value="000854">Northern Idaho Advanced Care</option>
<option value="000857">Mt Valley Regional</option>
<option value="000955">Laredo Specialty</option>
<option value="000956">Mesquite Specialty</option>
<option value="000958">Utah Valley Specialty</option>
</select>");
$this->paged_form_object->AddInputPart("fac_id");
if(IsSet($this->verify["fac_id"]))
$this->paged_form_object->AddDataPart("&nbsp;".$this->verify_field_mark);
$this->paged_form_object->AddDataPart("</TD>\n</TR>\n");

I get a parse error: unexpected T_STRING in /usr/local/php_classes/joe_incclass.php on line 324 (which is the line where I tried inserting the code for a drop-down - <select name=" ).

Any help would be appreciated.

TIA,

jej1216



  2. Re: How to add a drop-down field   Reply   Report abuse  
Picture of Joe Johnson Joe Johnson - 2007-04-19 19:49:53 - In reply to message 1 from Joe Johnson
Withdraw the question. I was putting the code in the wrong section.

Thanks,

jej1216