PHP Form Plus text

I created a php form and I need to insert some text about the field to tell users to select a product. I have tried ‘echo’, but when I put it in the middle of the form, it always pushes it up to the top. I have listed my form below. Thank you for your assitance.

<?php /** */ function my_form() { $form['name'] = array( '#type' => 'textfield', '#title' => 'Name', '#size' => '60', ); $form['title'] = array( '#type' => 'textfield', '#title' => 'Title', '#size' => '60', ); $form['phone'] = array( '#type' => 'textfield', '#title' => 'Telephone Number', '#size' => '60', ); $form['email'] = array( '#type' => 'textfield', '#title' => 'Email Address', '#size' => '60', ); $form['organization'] = array( '#type' => 'textfield', '#title' => 'Organization', '#size' => '60', ); $form['maincontact'] = array( '#type' => 'textfield', '#title' => 'Main Contact', '#size' => '60', ); $form['address'] = array( '#type' => 'textfield', '#title' => 'Street Address', '#size' => '60', ); $form['city'] = array( '#type' => 'textfield', '#title' => 'City', '#size' => '60', ); $form['state'] = array( '#type' => 'textfield', '#title' => 'State', '#size' => '60', ); $form['zip'] = array( '#type' => 'textfield', '#title' => 'Zip Code', '#size' => '60', ); /**WOULD TO HAVE TEXT HERE*/ $form['products'] = array( '#type' => 'select', '#title' => 'I need updates for', '#options' => array( 'Product 1' => '1', 'Product 2' => '2', '1 and 2' => '1 and 2' ) ); $form['submit'] = array( '#type' => 'submit', '#value' => 'Submit', ); return $form; } ?>

that code returns an array to somewhere else that actually builds the form. You need to either

A) add a text type to the form builder so that you can insert a text like you do with the other fields
B) enter it directly into the form builder
C) use javascript to insert it into the form after output

Sponsor our Newsletter | Privacy Policy | Terms of Service