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.

Using a HTML class for styling

  1. danielpettifer
    Member

    I would like to use "Niceforms" http://www.emblematiq.com/lab/niceforms/help/ with a gravity form but I do not know where to add the class. (It requires that I add class="niceform" to the form html). How is the html outputted? Which php file should I edit?

    I need to add the class and also link the form to another style sheet.

    Posted 13 years ago on Saturday March 19, 2011 | Permalink
  2. danielpettifer
    Member

    This is the code I need to add:

    <script language="javascript" type="text/javascript" src="niceforms.js"></script>
    <link rel="stylesheet" type="text/css" media="all" href="niceforms-default.css" />

    class="niceform"

    I have found calls for the other css & js librarys in form_detail.php, should I be editing this file?

    Posted 13 years ago on Saturday March 19, 2011 | Permalink
  3. There's no need to edit the core files. If you did, they would be overwritten when you run auto-updates on the plugin anyhow.

    You can add a custom class name to the form via the form editor. Click on the form name to open the form settings panel, then go to the advanced tab. You'll see the "CSS Class Name" field about half way down the panel.

    screenshot: http://grab.by/9yZa

    Posted 13 years ago on Saturday March 19, 2011 | Permalink
  4. danielpettifer
    Member

    ok but I still need to link the css and JS files for the form to output properly, the class will not work otherwise. Can I reference the css and Js in the form editor? If not I don't mind changing the core files, I will update them when you update them.

    Posted 13 years ago on Saturday March 19, 2011 | Permalink
  5. You don't need to edit the plugin to reference external files. You would add these to your WordPress theme in the header.php file.

    I guess you could add an HTML block in the form itself and add the script/css references in there. That all depends on how the js runs.. it may need to run BEFORE the form gets loaded.

    Posted 13 years ago on Saturday March 19, 2011 | Permalink
  6. danielpettifer
    Member

    Ok, thank you for your help & prompt reply, I will try these methods and let you know how it goes.

    Posted 13 years ago on Saturday March 19, 2011 | Permalink