Page 1 of 1

new to php question - changing form field types

Posted: Thu Oct 13, 2011 4:59 pm
by jannz
I'm implementing a WP Theme and need to customize one of the form fields. I've got a little background with forms but NOT when they're embedded in PHP code.

I need to change a form field from a "drop-down list selection box" to a "text-area" field. ie; Instead of someone making a SELECTION they will enter text into a text area field.

Below is the php code:

Code: Select all

<tr>
           <?php if (!empty($color3)){

            echo '<td><input type="hidden" name="on3" value="'.mkt_THEME_SINGLE_LABEL_COLOR3.'"/>'.mkt_THEME_SINGLE_LABEL_COLOR3.':</td>
              	  <td><select id="os3" name="os3" class="field">';
              
           	for($i=0; $i<count($colorlist3); $i++){
            	echo "<option value='$colorlist3[$i]'>$colorlist3[$i]</option>";
            }         
            
            echo '</select></td>'; 
			} ?>
        </tr>
Hopefully -- this is a simple change..??... if someone could point me to what I need to change...

Many thanks...

Re: new to php question - changing form field types

Posted: Thu Oct 13, 2011 5:12 pm
by Celauran
You mean like this?

Code: Select all

<tr>
<?php if (!empty($color3)){

    echo '<td><input type="hidden" name="on3" value="'.mkt_THEME_SINGLE_LABEL_COLOR3.'"/>'.mkt_THEME_SINGLE_LABEL_COLOR3.':</td>';
    echo '<textarea id="os3" name="os3"></textarea>';

} ?>
</tr>

Re: new to php question - changing form field types

Posted: Thu Oct 13, 2011 5:48 pm
by jannz
Let me make the changes to the files and see if it works OK.

Thanks so much for responding!
============

Edited to add: Ok.... this is going to be much harder than I thought. There are several other places in the file where they are building the LIST that is normally in a drop-down box. I thought I could just change the form field type... ugh. Is there a resource [website] where PHP coders are available for hire -- ??--