new to php question - changing form field types

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jannz
Forum Newbie
Posts: 2
Joined: Thu Oct 13, 2011 4:48 pm

new to php question - changing form field types

Post 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...
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: new to php question - changing form field types

Post 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>
jannz
Forum Newbie
Posts: 2
Joined: Thu Oct 13, 2011 4:48 pm

Re: new to php question - changing form field types

Post 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 -- ??--
Post Reply