Recent Topics

1 Feb 04, 2014 11:21    

My version is 5.0.6-stable. I need help with two things:

1. I'd like to remove the subject field from the _contact_msg.form.php file. I have tried commenting the field out, deleting it entirely, and changing the 'required' to false... but every time I try this the site gives me an error saying the field needs to be filled in.

2. I'd like to add a phone number field to the form. I can add in the field, but can't get the /htrsv/message_send.php file to forward the number with the rest of the email. I've checked the forums and the only relevant answer to this issue is me asking several years ago for help on a 'add to mailing list' field, but I have no idea how to covert the answer into something that works for a text input.

Any help or pointers would be greatly appreciated!

Thanks.

2 Feb 04, 2014 13:44

Hello @fredsy,

Please read the comment I just leave you in your "honeypot" post (http://forums.b2evolution.net/adding-a-honeypot). Maybe it could be useful to let you know how to hide the subject field, and also how to add a new field to the form. I guess you could concatenate your new phone field with the msg_text field, in order to add it to the whole message and properly send it by email.

Regards!

3 Feb 06, 2014 09:34

As I said, you can't just hide the subject field. If you hide it with css, it throws an error. If you comment out the field in _contact_msg.form.php, it throws an error. If you change the field from required=true to false, it throws an error. The only thing I found that works is hacking the htrsv/message_send.php and commenting out the error message itself:

// if( empty($subject) )
// {
//	$Messages->add( T_('Please fill in the subject of your message.'), 'error' );
// }

and then in the same file changing the $subject to 'message from your website'.

	{ // Send mail to registered user
		$success_message = send_mail_to_User( $recipient_User->ID, 'Message from your website', 'contact_message_new', $email_template_params, false, array( 'Reply-To' => $sender_address ) );


Form is loading...