• Resolved lostechoes

    (@lostechoes)


    Hello there.
    I have searched through the forums but I cannot seem to find the solution to my issue.

    So I’m building this site and I’m using Contact Form 7 for my “Contact Us” page

    https://mbraining.gr/epikoinwnia/

    I want to add a (required) Phone Number field, but while it seems to work, it does not inherit the CSS / style of my theme (Spacious theme)

    The code I add is this one:

    <label> Phone Number (required)
    [tel* phone] </label>

    and I’m getting this (it’s in Greek but you get the issue of the field style which is different from the other fields):

    https://s2.postimg.org/x1d2cm449/contact_Us.jpg

    Could someone help me find what I’m doing wrong and how to find a solution?

    Thank you in advance!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Try adding this in custom css

    
    .wpcf7 input[type="tel"] {
     width: 100%;
    }
    Thread Starter lostechoes

    (@lostechoes)

    Thank you for the feedback.

    The code you gave me fixed the width but the issue with the “line” style is still there.

    https://s15.postimg.org/avi3n0d0r/444.png

    A quick google found this, https://themegrill.com/support-forum/topic/styling-fields-in-contact-forms/

    Try the css mentioned there

    input[type="tel"] {
     background-color: #f8f8f8;
        border: 1px solid #eaeaea;
        border-radius: 3px;
        line-height: 20px;
        margin: 0 0 30px;
        padding: 1%;
        width: 98%;
    }

    Obviously you’ll need to remove the width css I mentioned before.

    I’m unsure why the field isn’t getting the CSS from your theme, i’m by no means an expert but if it were me I would use a colour picker to find the background colour of the other fields and then add

    background-color: (whatever hex value the other colour is);

    before the closing bracket above.

    Thread Starter lostechoes

    (@lostechoes)

    Thanks for the feedback, once again !

    The style works ok now by adding the second CSS code you posted !

    input[type=”tel”] {
    background-color: #f8f8f8;
    border: 1px solid #eaeaea;
    border-radius: 3px;
    line-height: 20px;
    margin: 0 0 30px;
    padding: 1%;
    width: 98%;
    }

    I feel like dumb that I did not find the topic you found

    https://themegrill.com/support-forum/topic/styling-fields-in-contact-forms/

    and even more now that I’ve just realized that adding this code to my CF7 form

    <label> Phone Number (required)
    [tel* phone] </label>

    is not enough, as the email I’m getting does not contain the phone number the sender has entered !
    I guess I have to re-read the instructions on the CF7 website.

    Thanks again.

    Look in the mail tab, in the email content do you have [phone] somewhere? If you’re not sure post your form code and email code here and i’ll take a look.

    Thread Starter lostechoes

    (@lostechoes)

    Thank you !

    I’ve added the [phone] tag in the message body box of the mail tab and now it seems to work fine !

    ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to add phone field ?’ is closed to new replies.