com_contact: How to remove the subject field?

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
mandingueiro
Joomla! Intern
Joomla! Intern
Posts: 90
Joined: Sat Jul 15, 2006 3:09 pm

com_contact: How to remove the subject field?

Post by mandingueiro » Mon Jan 11, 2010 3:49 am

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?

User avatar
ranwilli
Joomla! Master
Joomla! Master
Posts: 19203
Joined: Sun Feb 19, 2006 6:47 pm
Location: Toledo, OH
Contact:

Re: com_contact: How to remove the subject field?

Post by ranwilli » Mon Jan 11, 2010 4:02 am

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.
Don't HACK the Joomla! core, Instead "Extend" and/or "Override."
Stay ON the update path.
https://harpervance.com

User avatar
lausianne
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 162
Joined: Thu Apr 06, 2006 3:15 pm

Re: com_contact: How to remove the subject field?

Post by lausianne » Tue Oct 08, 2013 9:11 pm

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

visability
Joomla! Apprentice
Joomla! Apprentice
Posts: 13
Joined: Thu Aug 03, 2006 10:47 am
Location: South Africa
Contact:

Re: com_contact: How to remove the subject field?

Post by visability » Wed Aug 16, 2017 10:32 pm

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">
Pools and Swimming Pool builders - http://www.poolbuilders.co.za
Pools in Cape Town - http://www.poolbuilders.co.za/pool-buil ... -town.html


Locked

Return to “Extensions for Joomla! 1.5”