Add custom CSS code for a textbox in form
I do it like this:

function the_form($form, &amp;$form_state){
     $form['price'] = array(
       '#type' =&gt; 'textfield',
       '#title' =&gt; 'What is Your Price?',
       '#size' =&gt; 100,
       '#maxlength' =&gt; 10,
       '#required' =&gt; TRUE,
       '#prefix' =&gt; '&lt;div style="display:none;"&gt;',
       '#suffix' =&gt; '&lt;/div&gt;',
     );