• I am working on a wordpress project i have made a custom template for a page i have made a forum now i am applying Validation using a Jquery Validation Engine i am using this code in header.php in <header> tag

    <?php
    if (is_page_template('order.php')) {?>
    <script src="<?php bloginfo('template_directory');?>/js/jquery.js" type="text/javascript">
    </script>
    <script src="<?php bloginfo('template_directory');?>/js/english.js" type="text/javascript">
    </script>
    <script src="<?php bloginfo('template_directory');?>/js/jquery.validationEngine.js" type="text/javascript">
    </script>
    <link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/js/val.css" type="text/css" />
    <?php }?>

    There is also a Jquery image slider running in the page
    so if i include above code after wp_head() in header.php my validation functions work on form but slider doesnt i get this error

    jQuery("div#slider").nivoSlider is not a function

    if i place it before wp_head() my validation functions dont work but slider does i know there some conflict i get this error that

    jQuery("#formid").validationEngine is not a function

    this what i use to bind my form with validation

    jQuery(document).ready(function(){
                    // binds form submission and fields to the validation engine
                    jQuery("#order_frm").validationEngine();
                });
Viewing 1 replies (of 1 total)
  • You will need to do the following:

    1. Enqueue the script (language and core)
    2. Enqueue the styles
    3. Register the styles
    4. Add custom JS to header

    Ideally, you should build a plugin for this or customize your theme. The latter is usually the easier route for beginners.

    In your header files, add the JS and CSS files. Make sure you use the correct file location or it will not work. View the source and test the links that appear.

    Hope that helps…

Viewing 1 replies (of 1 total)
  • The topic ‘Jquery Validation Engine’ is closed to new replies.