Seeing as you are making separate contact pages for each category, wouldn't it be a good idea to remove the Categories drop-down from the main contact page? If others are interested in that, I am attaching a simple patch. If some people want to keep that, then maybe make it an option in the settings?

CommentFileSizeAuthor
contact_forms_remove-categories.patch442 bytesdavemybes

Comments

behindthepage’s picture

If you unset the $form['cid'] the form won't send to anybody. You need to replace the drop down menu with a hidden Form['cid'] value for the person you want it to go to. The code below (may work) gets the cid of one of the contact categories (should really be "order by weight") and uses that to replace the drop down menu.

I will leave it to you to see if this or any variation is of practical use for you.

  $query =  db_fetch_object(db_query("SELECT * FROM {contact} LIMIT 1"));

  $form['cid'] = array(
    '#type' => 'hidden',
    '#value' => $query->cid,    
    '#required' => TRUE,
  );

Thanks for your input. Keep it coming
gpdinoz

davemybes’s picture

Cool, thanks. I'll give that a try.

behindthepage’s picture

Project: » Contact Forms
Version: » 5.x-1.7
Status: Active » Closed (fixed)