0
<!DOCTYPE html>
<html>
<head>
    <title>Site :: </title>
    <link rel="stylesheet" media="screen" href="css/wicahost.css" />
    <link rel="stylesheet" media="screen" href="css/global.css" />
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script> 
    <script type="text/javascript" src="inc/js/valid.js"></script>
    <SCRIPT TYPE="TEXT/JAVASCRIPT">
    $(document).ready(function() {
        $("#splashtease").RSV({
          onCompleteHandler: myOnComplete,
                rules: [
                        "required,emAdd,Please enter your email address.",
                        "valid_email,emAdd,Please enter a valid email address.",
                       ]
        });
});
    </SCRIPT>
</head>

<body>
    <div id="splashTeaserBox">
    <h1>Signup!</h1>

    <form id="splashtease" action="inc/subscribe.php" method="post">
    <?php $usrBrowser = $_SERVER['HTTP_USER_AGENT']; $todayDt = date('Y-m-d');  ?>
    <input type="text" name="emAdd" />
            <input type="hidden" name="brwsr" value="<?php echo $usrBrowser ?>" />
            <input type="hidden" name="dt" value="<?php echo $todayDt ?>" />
        <input type="submit" name="submit" value="" class="splashteasesub" />
    </form>
    </div><!--splashTeaserBox-->
</body>
</html>

Trying to implement this simple example above to validate an email address: http://www.benjaminkeen.com/software/rsv/jquery/demo.php

The above code isn't doing anything and is just submitting to the database. I checked to make sure my jquery library link reference and jquery script for this 3rd party script to make sure they linked fine and both do link fine.

Anyone see what is going wrong here? Thanks :)

2
  • do you get a js error in firebug? Just noticing 'myOnComplete' in not defined here. Commented Aug 18, 2011 at 2:00
  • Pshh yes it does. I just tested it in jsfiddle. It throws this error "Uncaught ReferenceError: myOnComplete is not defined" Commented Aug 18, 2011 at 2:16

2 Answers 2

1

You are trying to bind an onCompleteHandler handler, but the variable you're providing does not reference a function. Rather, it is undefined. Remove it, and you'll be OK.

http://jsfiddle.net/XNXj3/

Sign up to request clarification or add additional context in comments.

Comments

1

myOnComplete isn't defined. rules has an extra comma after the second item

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.