elclanrs / jq-idealforms-old

The ultimate framework for building and validating responsive HTML5 forms.
665 stars 95 forks source link

There's no simple demo. #32

Closed cpidx closed 12 years ago

cpidx commented 12 years ago

I've tried following the directions in the documentation at least 10 times and can't get this plugin to work. Is it possible to add a couple demo.html files to the project to show how to do a simple and complex implementation?

elclanrs commented 12 years ago

The demo is a showcase of everything that's possible. What are you trying to do? Here's the simplest example I can think of. Make sure to load Ideal Forms into your project first. Hope this helps:

HTML:

<form id="myform">
  <div><label>Username:</label><input type="text" name="user" class="required username"/></div>
  <div><label>Password:</label><input type="password" name="pass" class="required pass"/></div>
  <div><label>E-Mail:</label><input type="email" name="email" class="required email"/></div>
</form>

jQuery:

$('#myform').idealforms();

If you want to use a custom path for your images instead of the default less/themes/basic you need to recompile the project into CSS. Follow this instructions:

The above can seem over-complicated if you're not familiar with CSS Preprocessors, like LESS, but it provides way more flexibility.

cpidx commented 12 years ago

Thanks - I figured it out now. It appears this plugin doesn't work well with Twitter Bootstrap. It's very nice though! Please let me know if you plan to offer a Twitter Bootstrap friendly version.

elclanrs commented 12 years ago

No, it doesn't work very well. Twitter Bootstrap for some reason opted to use global css styles in form.less, styles that are beyond a reset or normalizer, and even more problematic is that most of the values are set in pixels. Ideal Forms uses the namespace ideal just like jQuery UI uses the namespace ui for example; I don't understand why Bootstrap doesn't follow this common practice.

I don't plan to add support right away, because I'm working on other stuff that I consider more relevant, but I might add it in the future.

For now, your best option to make it work properly would be to remove all the form related stuff from Bootstrap. You can do this in two ways:

Download a custom build

Re-compiling it yourself

Unless there are some other global problematic styles elsewhere this should do it.

cpidx commented 12 years ago

That worked great! Thank you.