#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    22
    Rep Power
    0

    Form Validation using jQuery


    hi,

    I am using jquery validation for my form. Initially I was using prototype.js and scriptaculous.js but it had conflicts with jquery I was using on my site so I decided to use jquery for form validation. So this is what i've done

    <script type="text/javascript" src="js/jquery-1.5.2.min.js"></script>
    <script type="text/javascript" src="js/jquery.validate.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    $("#subscribe_newsletter").validate();
    });
    </script>


    <div class="right-box-head" style="width:100%;"><span class="right-box-head-text">Subscribe to Newsletter</span>
    <form name="subscribe_newsletter" id="subscribe_newsletter" method="post" action="subscribe_newsletter.php">
    <div class="right-box">
    <div class="newsletter-label">
    Full Name
    </div>
    <div class="newsletter-input">
    <input maxlength="40" type="text" name="fname" id="fname" class="required"/>
    </div>
    <div class="newsletter-label">
    Email
    </div>
    <div class="newsletter-input">
    <input maxlength="100" type="text" name="email" id="email" class="required email"/>
    </div>
    <div id="newsletter-submit">
    <input class="submit-button" type="submit" name="s1" id="s1" value="Subscribe" />
    </div>
    </div>
    </form>
    </div>

    I used this from a tutorial online but for me it's not working.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,971
    Rep Power
    375
    is this PHP or Javascript problem?

IMN logo majestic logo threadwatch logo seochat tools logo