Adding a Middle Initial field to the full name field

  • PHXPM
    Asked on July 20, 2018 at 1:48 PM

    Hello, I would like to add a middle initial box to the Full Name Form Element. Is there a way to do that?

  • Adrian
    Replied on July 20, 2018 at 2:09 PM

    Yes, you can do that by setting the Middle Name option in the field's properties to ON.

    1532110127midn Screenshot 10

    Demo: https://form.jotform.com/81115930048956


  • PHXPM
    Replied on July 24, 2018 at 10:57 AM

    Is there a way to change the name of the field to "Middle Initial" as opposed to "Middle Name" and to make the actual box smaller?

    If there is an additional cost associated with this request, please advise as our client would like these two changes incorporated

  • David JotForm Support
    Replied on July 24, 2018 at 12:16 PM

    The sub-labels for each part of the full name field can be changed to whatever you'd like:

    1532448779Capture Screenshot 10

    For the width of the middle name portion, adding the following code to the form would adjust it:

    https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes

    #middle_9, #sublabel_middle {
        width : 40px;
    }

  • PHXPM
    Replied on July 25, 2018 at 10:16 AM

    When making the middle name box smaller, a gap is created because "Middle Initial" is longer than the box.

    Is there a code to create a line break in the middle name sublabel so that it appears as

    Middle
    Initial

    and gets rid of the extra space in between the middle name box and Last name box?

    1532528126middle name Screenshot 10

    I've found the below code but it puts "initial" under every field and I just need it under the Middle Name fields. 

    #cid_9 .form-sub-label:after {
    display:flex;
    content: "Initial";

    }

  • David JotForm Support
    Replied on July 25, 2018 at 11:19 AM

    The code I suggested does something similar:

    #middle_9, #sublabel_middle {
        width : 40px;
    }

    The #sublabel_middle portion targets the sub-label for the middle initial field and makes it the same width as the input.  When that is shorter than the actual text, the text is wrapped similar to your example.

  • PHXPM
    Replied on July 25, 2018 at 11:49 AM

    I want to create a line break in the word "Middle Initial" so that the space (marked with an x in the below image) is no longer visible.

    1532533690middle name Screenshot 10

    The code you provided only allows me to make the box smaller, the text does not wrap.

    Is there a code that can achieve this? I want ...

    Middle Initial to be

    Middle
    Initial

  • Adrian
    Replied on July 25, 2018 at 12:32 PM

    I have checked your form and the middle name is appearing as you have requested.

    1532536226f1 Screenshot 10

    The following code should be sufficient.

    #middle_9, #sublabel_middle {
        width : 50px;
    }

    Let us know if you need further assistance.

  • PHXPM
    Replied on July 25, 2018 at 4:33 PM

    you are correct. i did not check the "preview mode" of the form. THANK YOU!