XF 2.2 Remove input requirements for Contact Form

IcoHolic

Member
I was wondering if anyone could tell me now to remove input requirements in the contact form for xf2?

I only want hcaptcha and "message" as required, I would like to remove the requirement for name/email address/subject.

Any insight would be appreciated.
 
You can edit the contact_form template as you want.

Yes, I've done my best but still can't remove the requirement! I'm not a skilled human on this side of things.

PHP:
<xf:title>{{ phrase('contact_us') }}</xf:title>
<xf:form action="{{ link('misc/contact') }}" class="block" ajax="true" data-force-flash-message="true">
    <div class="block-container">
        <div class="block-body">
            <xf:if is="!$xf.visitor.user_id">
                <xf:textboxrow name="username" autofocus="autofocus" maxlength="{{ max_length($xf.visitor, 'username') }}"
                    label="{{ phrase('your_name') }}" required="required" hint="{{ phrase('required') }}" />

                <xf:textboxrow name="email" maxlength="{{ max_length($xf.visitor, 'email') }}" type="email"
                    label="{{ phrase('your_email_address') }}" required="required" hint="{{ phrase('required') }}" />
            <xf:else />
                <xf:formrow label="{{ phrase('your_name') }}">{$xf.visitor.username}</xf:formrow>
                <xf:if is="$xf.visitor.email">

                    <xf:formrow label="{{ phrase('your_email_address') }}">{$xf.visitor.email}</xf:formrow>

                <xf:else />

                    <xf:textboxrow name="email" type="email"
                        label="{{ phrase('your_email_address') }}" required="required" hint="{{ phrase('required') }}" />

                </xf:if>
            </xf:if>

            <xf:captcharow label="{{ phrase('verification') }}" hint="{{ phrase('required') }}" force="{$forceCaptcha}" />

            <xf:textboxrow name="subject"
                label="{{ phrase('subject') }}" required="required" hint="{{ phrase('required') }}" />

            <xf:textarearow name="message" rows="5" autosize="true"
                label="{{ phrase('message') }}" required="required" hint="{{ phrase('required') }}" />
        </div>
        <xf:submitrow submit="{{ phrase('send') }}" />
    </div>
    <xf:redirect />
</xf:form>

I've removed the "required" things that I don't want, but I'm still missing something!

Any insight would be welcomed.
 
Back
Top Bottom