PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Required fields not being asked for

  1. drtanz
    Member

    Hi I have set the required fields on my form at http://tinyurl.com/35uzgsd but as you can see only the email is being asked for, when it should also be asking for the name, surname and message fields. They are set as required in the admin screens. What else can be the problem?

    Posted 9 years ago on Monday October 4, 2010 | Permalink
  2. drtanz
    Member

    Also this form takes ages to submit on Firefox, while it works perfectly fine on Chrome and IE, apart from the validation problems mentioned in the previous post.

    Posted 9 years ago on Monday October 4, 2010 | Permalink
  3. The validation is working properly, the issue reason you're not seeing it is because there is already a default value of "Name", "Surname", etc. in the field which the form thinks is valid. It does flag "Email" because it's not in the right format.

    I submitted a test with firefox (mac) - the form sent & I received confirmation in 2 seconds. Hard to say why you're having a problem with it.

    Posted 9 years ago on Monday October 4, 2010 | Permalink
  4. drtanz
    Member

    OK in the meantime realised my mistake, validation for email is working fine because it is checking for a valid email address, and 'Email' is of course not a valid email address. So what I want now is that the form tests that if for example the name field is either empty or equal to 'Name' then an error message is displayed. How can I do that? In other words I need to add an extra validation step (='Name') apart from the required validation.

    Posted 9 years ago on Monday October 4, 2010 | Permalink
  5. This isn't currently possible. Validation checks for a value in those fields, not for the specific value but any value. If you want to implement placeholder text that clears when they click on the field then you need to implement it as a jQuery customization.

    See this forum post:

    http://www.gravityhelp.com/clearing-default-form-field-values-with-jquery/

    Posted 9 years ago on Monday October 4, 2010 | Permalink
  6. drtanz
    Member

    Thanks but that doesn't solve my problem unfortunately. If a user leaves all the fields untouched and clicks the submit button the form will accept the input as valid as the fields are filled in, although in reality the user would not have typed in his name for example, only the default 'Name'would be showing.

    Posted 9 years ago on Monday October 4, 2010 | Permalink
  7. drtanz
    Member

    Thinking about, maybe I could have jquery clear the form values if they are any of the following default values: 'Name', 'Surname', 'Message'. This would happen just before the form processing so the validation would work correctly as no values would be found. Unfortunately I'm not good with jquery so I don't know how this could be implemented, but I sure need a solution to this problem as it is the only problem left on this site, any help would be appreciated :)

    Posted 9 years ago on Monday October 4, 2010 | Permalink
  8. Instead of using the default field value, you may have better results implementing a script like this.

    http://plugins.jquery.com/project/labelify

    That should avoid any conflicts with the form validation.

    Posted 9 years ago on Tuesday October 5, 2010 | Permalink
  9. drtanz
    Member

    very interesting didn't know about that, in the meantime fixed the issue by implementing my previously mentioned idea, but I'll use the method you suggested next time, thanks!

    Posted 9 years ago on Tuesday October 5, 2010 | Permalink