What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Can I Add placeholder text to empty fields?

    Asked by johnboy666 on June 07, 2016 at 11:40 AM

    Hi there,

     

    I have a form in use that does NOT require the user to complete every field and I'd like to keep it that way.

     

    BUT - Fields that are left empty are causing issues further down the line when I import into my Wordpress database.

    Is it possible to automatically add a "-" or similar to all empty fields when user clicks Submit?

    Page URL:
    https://www.petshelddear.com/add-your-online-pet-memorial/

    placeholder text placeholder all and OR left
  • Profile Image
    JotForm Support

    Answered by david on June 07, 2016 at 01:03 PM

    You could add a default value to each field. 

    Though, this would show the default value in the form, rather than the hint text.

  • Profile Image

    Answered by johnboy666 on June 09, 2016 at 04:44 AM

    Hi David,

     

    Thanks for this. I did wonder about that but was hoping to keep the placeholder text.

     

    Having said that - I wonder if it was some kind of jotform bug as yesterdays forms all came through O.K.

  • Profile Image
    JotForm Support

    Answered by Mike_G on June 09, 2016 at 06:54 AM

    If I'm not mistaken, even if there is a placeholder, but fields are left unfilled and it is set as required, the form will still not submit. And, there is no option or condition to retain the placeholder text during submission. There is, also, no option available to fill empty fields during submissions nor there is a condition that will affect the behavior of the submit button and fill empty fields when it is clicked.

    With regards to what you said that happened yesterday, were you able to submit your forms with empty fields but it was filled automatically during submission? That seems odd because of what I have explained above. I'm not sure what happened, but if you encounter the same, please feel free to contact us anytime with more details. 

    You can also try to set default values to the fields, then, use Javascript so when the text fields are focused it will be cleared. This would mean, however, that you need to embed your form using its full source code.

    http://stackoverflow.com/questions/5324159/how-to-clear-text-field-on-focus-of-text-field

    Thank you.

  • Profile Image

    Answered by johnboy666 on June 09, 2016 at 07:08 AM

    Hi Mike,

     

    Yes I was able to submit forms because the fields in question are not set as "required" and I'd like to keep it that way as not every field is required by all my users.

    However - Because I'm sending post data to Wordpress which uses that data to create a post/page on my website...

    This left me with an issue that meant the post/page was not created properly.

    I'll keep an eye on this and see how it goes over the next few days.

  • Profile Image
    JotForm Support

    Answered by Nik_C on June 09, 2016 at 08:55 AM

    What crossed my mind is that you could possibly use email submission for adding, for example: - . What I'm thinking is to edit your Notifier email and add - for every field, or at least for every not required field:

    You will get something like this in your email:

    Now, I'm aware that, this will add the - sign even if there is some text in it, but I'm not sure if this could work for you?

    Please let us know what do you think.

    Thank you!

  • Profile Image

    Answered by johnboy666 on June 10, 2016 at 11:11 AM

    Ah I see - That's a good idea, I'll give it a try and report back.

     

    Thanks very much!

  • Profile Image

    Answered by johnboy666 on June 17, 2016 at 05:51 AM

    Hi Nik,

     

    Just to update you - I have tried this but unfortunately it hasn't worked.

    I'm now thinking the issue is not with empty fields but some kind of coding problem.

    Unfortunately I'm not a developer so will have to get this looked at by a pro.

  • Profile Image
    JotForm Support

    Answered by Nik_C on June 17, 2016 at 08:59 AM

    I'm sorry that it couldn't work for you.

    If you need any help from our side, please let us know.