Linking to Contact Us Page

dangonay

Active member
I wanted to use the Xenforo Contact Us page instead of creating a separate contact form for my home page. So I simply linked to: mysite.com/forums/index.php?misc/contact which brings up the contact page as you'd expect (in a regular window).
Once you enter the details and hit "send" you get a confirmation popup at the top of the screen that says "message has been sent". However, after this popup goes away, all the fields in the form still contain your info and the captcha field is blank. If you didn't catch the "message has been sent" popup, you might think that you entered the captcha phrase wrong and need to try again.

I'd like to have the confirmation message stay on the screen longer so the user knows the message was sent. Even better would be able to have the Contact Us form appear as a popup on my home page like it does if you were on a forum page when you clicked the link.
 
You can remove the AJAX submission with a template edit, but there is still no stop message.

One option is to specify a redirect:

Admin CP -> Appearance -> Templates -> contact

Add the red code:

Rich (BB code):
<xen:title>{xen:phrase contact_us}</xen:title>

<form data-redirect="on" action="{xen:link 'misc/contact'}" method="post" class="xenForm formOverlay AutoValidator">

<input type="hidden" name="redirect" value="{xen:link index}" />

	<xen:if is="{$visitor.user_id} == 0">
		<dl class="ctrlUnit">
			<dt><label for="ctrl__guestUsername">{xen:phrase your_name}:</label></dt>
			<dd><input type="text" name="_guestUsername" value="{$visitor.username}" id="ctrl__guestUsername" class="textCtrl" autofocus="true" /></dd>
		</dl>
		
		<dl class="ctrlUnit">
			<dt><label for="ctrl_email">{xen:phrase your_email_address}:</label></dt>
			<dd><input type="text" name="email" id="ctrl_email" class="textCtrl" /></dd>
		</dl>
	<xen:else />
		<dl class="ctrlUnit">
			<dt><label>{xen:phrase your_name}:</label></dt>
			<dd>{$visitor.username}</dd>
		</dl>
		
		<dl class="ctrlUnit">
			<dt><label for="ctrl_email">{xen:phrase your_email_address}:</label></dt>
			<dd>{$visitor.email}</dd>
		</dl>
	</xen:if>

	<xen:include template="helper_captcha_unit" />

	<dl class="ctrlUnit">
		<dt><label for="ctrl_subject">{xen:phrase subject}:</label></dt>
		<dd><input type="text" name="subject" class="textCtrl" id="ctrl_subject" /></dd>
	</dl>

	<dl class="ctrlUnit">
		<dt><label for="ctrl_message">{xen:phrase message}:</label></dt>
		<dd><textarea name="message" class="textCtrl Elastic" id="ctrl_message" rows="5"></textarea></dd>
	</dl>

	<dl class="ctrlUnit submitUnit">
		<dt></dt>
		<dd><input type="submit" value="{xen:phrase send_message}" accesskey="s" class="button primary" /></dd>
	</dl>

	<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
</form>
 
i want to redirect my page to same contact page so i used misc/contact in place of index but no changes has done...still it is redirecting to index page ???? please help me
 
Back
Top Bottom