How To Hide the Contact Button and Replace with a Message I'm building a room letting website.
Next to every advert is a send user private message button.

If the room is no longer available.
I want to replace the button with the message "Sorry room no longer available"
how can I do this please?

Many Thanks for your help
Charles
You can use hook_form_alter. Find your form name and use the code below (form api doc).

function yourmodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
if($form_id=='your_form_id'){
 hide($form['#submit']);
$form['mymessage']= array(
   '#type' =&gt; 'markup',
   '#markup' =&gt; 'sorry , no one available in room',
   '#weight' =&gt; 0,
);
}
}