Page 1 of 1

com_contact: How to remove the subject field?

Posted: Mon Jan 11, 2010 3:49 am
by mandingueiro
Hello there ppl!

I think the subject says it all: I want to remove the subject field from the contact form. How can I do this?

Re: com_contact: How to remove the subject field?

Posted: Mon Jan 11, 2010 4:02 am
by ranwilli
Read up on template over rides... hacks you make in the regular core code could be overwritten in every security upgrade.

Then revise the /com_contact/contact/default_form.php to remove these code lines:

Code: Select all

	<div class="contact_email<?php echo  $this->escape($this->params->get( 'pageclass_sfx' )); ?>"><label for="contact_subject">
		<?php echo JText::_( 'Message subject' ); ?>:</label>
		<input type="text" name="subject" id="contact_subject" size="30" class="inputbox" value="" />
	</div>
Back everything up first, of course.

Re: com_contact: How to remove the subject field?

Posted: Tue Oct 08, 2013 9:11 pm
by lausianne
Hi,

years later, anyone still reading this?

Anyway, I did what ranwilli explained, before I even got here ...
The problem now is validation. The field is gone, and when the form is sent, I get a validation error, because the field is not filled in.
Where can the validation for this field be switched off?

Thanks!

BTW. It's on J!3.1 now, but in principle it should work similarly, I presume

Re: com_contact: How to remove the subject field?

Posted: Wed Aug 16, 2017 10:32 pm
by visability
Even more years later...

I replaced the code with a hidden field like this:

<input id="jform_contact_emailmsg" class="required" name="jform[contact_subject]" value="" size="60" required="required" aria-required="true" type="text">