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

    What DOCTYPE should I use when exporting source?

    Asked by jfedcle on May 18, 2011 at 10:34 PM

    Every doctype available at the w3 validator fails. For the "older" doctypes it's because of things like type="email" on input fields. For the "newer" doctypes, it's because certain tags aren't closed properly. For all doctypes, there are various other errors and warnings as well.

    I think my preference would be xhtml 1 transitional but I'm afraid that changing the type attribute on various fields may break the form.

    Please advise. Thanks!

  • Profile Image

    Answered by DanielGriffin on May 19, 2011 at 05:56 PM

    Hi there,

    Thanks for your question.  i've just noticed that downloaded source has its doctype set as strict whereas pages on jotform as set as transitional.  I will need to forward this issue to the devs and hopefully they can get to the bottom of it.  In the meantime I suggest try using loose to get around any minor issues. 

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

    If you are downloading the source anyway you could also try to address the issues you see such as closing tags etc.  If you can send me the url of the page I will take a proper look at the source for you.

    Thanks,

    Daniel

  • Profile Image

    Answered by jfedcle on May 19, 2011 at 11:57 PM

    Thanks Daniel. http://www.jcfhosting.com/jvn/lunchregistrationform.html

    When I download the source, there is no DOCTYPE. The code begins with some scripts, stylesheets, and then the <form> tag. No body, head, etc. But I know to add that.

    And I can change the tags to fix the,. But I am hesitant and need your assurance that if I (choose to a looser doctype and) change the "type" attribute value on certain <inputs> from, say, "tel" to "text", won't break functionality.

    As long as you're looking at it, any reason to not close registration using a css class as a javascript "trigger" as I do?

  • Profile Image

    Answered by DanielGriffin on May 20, 2011 at 03:54 PM

    Hi there,

    In that case it sounds like you are just downloading the script block.  But you can download the full source easily by clicking Embed Form and then click the Source icon

     

    There is a link ( called "here" ) to the full source on the page the opens:

    Looking at that now I see that it's actually a refined version so it is intentionally using a different doc type so I'll close the ticket to the devs. 

    If you download the full source you can edit it in anyway that you like.  If the html and css is correct (note you might need to do some tidying here) then you should be ok.  But it depends on a few things like the device or browser accessing the page.  Generally even pages that fail validation will still work if the problems aren't too serious.  Although obviously valid mark up is far better.

    I'm not entiurely sure what you mean by closing registration.  Are you trying to disable the form?  If you can send the javascript i'll give you my option, but really the best thing to do will be to experiment with it yourself.  i don't think it should be a problem though...  JavaScript actually works on the DOM tree generated by the browser so as long as the markup is all well formed you should be able to do whatever you like to it.

    hope this helps,

    thanks,

    Daniel

  • Profile Image

    Answered by jfedcle on May 23, 2011 at 03:44 PM

    Hi Daniel,

    I've been downloading the source as you describe above. It starts with html that would normally appear in the <head> tag: the <script>, <link>, and <style> tags.

    It then has the <form> tag.

    There's no doctype, html, head, or body tags.

    That said, when I take the <form> tag and its inner html and attempt to validate it as a snippet at the w3 validator, validation fails as described originally. Again, with a loose doctype it fails because of modern html such as type="tel". With more modern doctypes, the same html fails validation because of old html such as unclosed self-closing tags.

    As mentioned above, these are just the two simple types of validation failures that occur with each doctype but there are numerous other types of validation errors as well.

    Thanks,

    Shmuel

  • Profile Image

    Answered by jfedcle on May 23, 2011 at 03:46 PM

    I should probably add that the reason I'm doing this is because I'm trying to debug some other issues I'm working on and validation is always a good first step, and surprisingly often related to logical and/or presentation bugs.

    Those other issues are elsewhere in the forum but not relevant to this thread.

  • Profile Image
    JotForm Support

    Answered by liyam on May 23, 2011 at 11:57 PM

    Hello jfedcle,

    The use of doc types depend on the content of your HTML page.  The doctype in HTML4 requires a reference to a DTD because it is based on standard generalized markup language. If you wish to use tags that are already depreciated, it would be best to use a loose DTD.

    In HTML5, there is no doctype referencing. So if you are going to use HTML5, you can simply use this one:

    <!DOCTYPE HTML>

    If you have other questions or concerns, please let us know.

  • Profile Image

    Answered by yolivar on August 01, 2011 at 07:29 AM

    HELP PLEASE!

    I follow your advise to change the DOCTYPE in order to pass the W3 Validation. I'm not planning to use HTML5, therefore I change to loose as you indicated. However I still have errors, to be exact 4 errors and 2 warnings ='(

    Since I don't know to much about HTML, I choose JotForm because it does the code for my, but now I don't know how to work around the errors by myself. Would you be so kind to advise my how to correct those errors (if apply)...

    Here are the errors specifications:

    Validation Output: 4 Errors Error Line 220, Column 117value of attribute "id" invalid: "1" cannot start a name … method="post" name="form_12052550281" id="12052550281" accept-charset="utf-8">

    It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.

    Error Line 274, Column 39value of attribute "type" cannot be "email"; must be one of "text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button" <input type="email" class="form-textbox validate[Email]" id…

    The value of the attribute is defined to be one of a list of possible values but in the document it contained something that is not allowed for that type of attribute. For instance, the “selected” attribute must be either minimized as “selected” or spelled out in full as “selected="selected"”; a value like “selected="true"” is not allowed.

    Error Line 279, Column 128value of attribute "type" cannot be "tel"; must be one of "text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button" …><input class="form-textbox" type="tel" name="q9_telefono9[area]" id="input_9_…

    The value of the attribute is defined to be one of a list of possible values but in the document it contained something that is not allowed for that type of attribute. For instance, the “selected” attribute must be either minimized as “selected” or spelled out in full as “selected="selected"”; a value like “selected="true"” is not allowed.

    Error Line 281, Column 200value of attribute "type" cannot be "tel"; must be one of "text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button" …><input class="form-textbox" type="tel" name="q9_telefono9[phone]" id="input_9…

    The value of the attribute is defined to be one of a list of possible values but in the document it contained something that is not allowed for that type of attribute. For instance, the “selected” attribute must be either minimized as “selected” or spelled out in full as “selected="selected"”; a value like “selected="true"” is not allowed.

    Warning Line 278, Column 66reference to non-existent ID "input_9" … <label class="form-label-left" id="label_9" for="input_9"> Teléfono </label>

    This error can be triggered by:

    A non-existent input, select or textarea element A missing id attribute A typographical error in the id attribute

    Try to check the spelling and case of the id you are referring to.

    Warning Line 258, Column 67reference to non-existent ID "input_13" <label class="form-label-left" id="label_13" for="input_13">

    This error can be triggered by:

    A non-existent input, select or textarea element A missing id attribute A typographical error in the id attribute

    Try to check the spelling and case of the id you are referring to.

  • Profile Image

    Answered by allanftd on August 01, 2011 at 08:46 AM

    @yolivar,

    May we ask for the URL of the webpage where your form is embedded and checked for W3C Validation compliance? We'll try to dissect these errors so that you can perform the necessary changes to make it 100% compliant.

    Thank you for using JotForm!

    JOTFORM SUPPORT

  • Profile Image

    Answered by yolivar on August 01, 2011 at 04:45 PM

    Yes please, you can check the form page at http://www.iglesialatinoamericana.org/yoli/comentarios.html, I embedded the code and once at my site I did some minor changes (most CSS preferences)

    btw, in the original form I set the yellow hightlight on focused inputs and edit the warnings text but now that it uploaded in the server they don't show up anymore??? I wondering if I changed any funcionality?? 

     

  • Profile Image

    Answered by allanftd on August 02, 2011 at 04:26 AM

    Hi Yolivar,

    I was able to run the validator to check your website and here are a few explanations:

    Error Line 224, Column 117: value of attribute "id" invalid: "1" cannot start a name

    This is a non-service impacting error. No action required here. JotForm IDs start with a number, hence it starts with a digit.

    Error Line 278, Column 39: value of attribute "type" cannot be "email"; must be one of "text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button"

    Error Line 283, Column 128: value of attribute "type" cannot be "tel"; must be one of "text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button"

    Error Line 285, Column 200: value of attribute "type" cannot be "tel"; must be one of "text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button"

    These are also non-service impacting errors. The input type "tel" and "email" is used primarily for mobile devices, smartphones like iPhone and Android-powered phone in particular, as built in form validation. For example, if an input type is "tel" an iPhone would automatically provide a soft keypad of numbers instead of letters. I'm pretty sure this will become acceptable in W3C standards very soon.

    Error Line 285, Column 257: end tag for "input" omitted, but OMITTAG NO was specified

    Error Line 283, Column 183: end tag for "input" omitted, but OMITTAG NO was specified

    These are non-service affecting errors which can be resolved by ending these lines with a " /> " instead of  " > " (remove the quotes " " )

    Warning Line 282, Column 66: reference to non-existent ID "input_9"

    Warning Line 262, Column 67: reference to non-existent ID "input_13"

    These are non-service affecting warnings which can be resolved by removing the for="input_9" and for="input_13" attribute found on lines 282 and 262 respectively.

    In summary, these are all non-service impacting errors and warnings, which means your website will still function properly, especially the form embedded. If you are okay with it, you can leave it as it is. But if you are very particular with W3C compliance, you can go ahead and perform our suggested actions above (if applicable).

    Regarding your other question, it is possible that your text editor automatically removed javascripts included in te form embed code. To resolve this, have you tried using other embed code types such as Iframe embed code?

    Iframes are excellent in resolving conflicting scripts or text editors that don't like scripts, since the form embed code remains intact and remains hosted by JotForm.

    We hope you find this information helpful. Thank you for allowing us to help you today!

    JOTFORM SUPPORT