Add fields to Contact Us Page

I would like to edit the contact us form so i can add more fields to it but i dont know from where should i start so if anyone could guide me through it?
or should i make a new web form to meet my requirements and hide the contact page?

What kind of field?
Have you tried following the manual?
Link:https://erpnext.org/docs/user/manual/en/website

Also Check Website > Contact us Settings

Yes i have tried but nothing is there to add custom fields to the contact us page
i would like to add drop down and more data fields

any help?

@Abdallah_Korraim Hello, Were you able to resolve this??

same here

Any solution yet? i also want to add custom field on the standard contact us page.

Facing in same problems

This guy seem to have worked on this.
https://fosserp.com/contact-us

@Basawaraj_Savalagi may shed some light on it. I believe that he created a new Web Form.

@TurkerTunali thanks for the link will connect Basawaraj for more details

@Abhijit_undre Frappe documentation states:

Frappe also allows you to override standard pages through your custom app. For example, to override the standard /about provided by frappe, just add a file named about.html in the www folder of your app and it will take precedence.

Same goes for contact.html, and the following is the JavaScript code used by Frappe.

frappe.ready(function() {

	if(frappe.utils.get_url_arg('subject')) {
	  $('[name="subject"]').val(frappe.utils.get_url_arg('subject'));
	}

	$('.btn-send').off("click").on("click", function() {
		var email = $('[name="email"]').val();
		var message = $('[name="message"]').val();

		if(!(email && message)) {
			frappe.msgprint('{{ _("Please enter both your email and message so that we can get back to you. Thanks!") }}');
			return false;
		}

		if(!validate_email(email)) {
			frappe.msgprint('{{ _("You seem to have written your name instead of your email. Please enter a valid email address so that we can get back.") }}');
			$('[name="email"]').focus();
			return false;
		}

		$("#contact-alert").toggle(false);
		frappe.send_message({
			subject: $('[name="subject"]').val(),
			sender: email,
			message: message,
			callback: function(r) {
				if(r.message==="okay") {
					frappe.msgprint('{{ _("Thank you for your message") }}');
				} else {
					frappe.msgprint('{{ _("There were errors") }}');
					console.log(r.exc);
				}
				$(':input').val('');
			}
		}, this);
		return false;
	});

});

var msgprint = function(txt) {
	if(txt) $("#contact-alert").html(txt).toggle(true);
}
1 Like

Yes, that is a custom web form.

1 Like