1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Contact Us - extra fields

Discussion in 'XenForo Questions and Support' started by Morgain, Jan 2, 2013.

  1. Morgain

    Morgain Well-Known Member

    Can anyone tell me how to add extra fields to the Contact Us form?
    I've done it with other email scripts so I know the outline.
    I guess I need to

    - add the fields and label text to the correct frontend template
    (copy an existing field snippet and tweak)

    - add that field name to the correct form function file for it to include in the notification email to me
    ( copy an existing line of code and tweak)

    So any chance of a nudge on where to find these two, the frontend template and the script?
  2. Slavik

    Slavik XenForo Moderator Staff Member

    If I recall correctly the email templates are under the development tab rather than the templates section.
  3. Slavik

    Slavik XenForo Moderator Staff Member


    Enable debugging then the template you want is

  4. Morgain

    Morgain Well-Known Member

    Oh cripes now I have to figure it out! Thank you Slavik.
  5. Morgain

    Morgain Well-Known Member

    Ok there is an ordinary template for what the email form looks like, and I can add fields to it.
    I think I need to make matching values in the template you told me.

    But now I have 5 textboxes as well as the textarea which looks a bit daunting.
    It would look better if the textboxes were not so big- wide.

    I checked Forms in Style Props but there's no control for the textbox, only the label.

    The textbox code in the Contact template is
                <dd><input type="text" name="_guestUsername" value="{$visitor.username}" id="ctrl__guestUsername" class="textCtrl" autofocus="true" />
  6. Morgain

    Morgain Well-Known Member

    I got a certain amount done.
    I was able to restrict the width of the input textboxes by simply adding width=25" to their code.
    I also made the subject line hidden - type="hidden" - so I can use message rules on it on my end.

    I also added two text fields to the form, with their labels.
    But the test info I put in them does not get included in the email body which is what I want them to do.
    From other email scripts I've configured before I imagine I need to insert the ID if these fields in the form script itself which sends the email.
    So where is that?

    Finally the processing of this form is minimalist to say the least. I would like a courtesy confirmation page to appear which I can customise to say thanks your email has been sent and we'll answer within a few hours.
    can anyone help me with that? I know it's very standard php mail so I might be able to figure it out but as I don't have access to the form script I cant do it yet.

Share This Page